From e862e45e87e4a238f137db5868be7608dd687611 Mon Sep 17 00:00:00 2001 From: serpilliere Date: Mon, 16 Jun 2014 10:31:05 +0200 Subject: Jit python: handle jump to ExprId (asm_label) --- miasm2/jitter/jitcore_python.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'miasm2/jitter/jitcore_python.py') diff --git a/miasm2/jitter/jitcore_python.py b/miasm2/jitter/jitcore_python.py index afa9b0fe..e054efa5 100644 --- a/miasm2/jitter/jitcore_python.py +++ b/miasm2/jitter/jitcore_python.py @@ -84,8 +84,9 @@ class JitCore_Python(jitcore.JitCore): if irb.label == cur_label: loop = True break - if loop is False: - break + + # Irblocs must end with returning an ExprInt instance + assert(loop is not False) # Refresh CPU values according to @cpu instance for symbol in exec_engine.symbols: @@ -115,6 +116,8 @@ class JitCore_Python(jitcore.JitCore): # Manage resulting address if isinstance(ad, m2_expr.ExprInt): return ad.arg.arg + elif isinstance(ad, m2_expr.ExprId): + cur_label = ad.name else: raise NotImplementedError("Type not handled: %s" % ad) -- cgit 1.4.1