about summary refs log tree commit diff stats
path: root/miasm2/analysis/data_flow.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2019-02-12 07:19:38 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2019-02-18 22:49:33 +0100
commit79a2ab0f9c54abdd586c3cd65268ba37743ff800 (patch)
tree390e71ce579ad907d3cf9c98848f4067771f6b1c /miasm2/analysis/data_flow.py
parent53c5f000e76852956fdb9a456c8e33ad63f556c0 (diff)
downloadmiasm-79a2ab0f9c54abdd586c3cd65268ba37743ff800.tar.gz
miasm-79a2ab0f9c54abdd586c3cd65268ba37743ff800.zip
Fix has_call test
Diffstat (limited to 'miasm2/analysis/data_flow.py')
-rw-r--r--miasm2/analysis/data_flow.py24
1 files changed, 3 insertions, 21 deletions
diff --git a/miasm2/analysis/data_flow.py b/miasm2/analysis/data_flow.py
index 446d09be..dc72d06a 100644
--- a/miasm2/analysis/data_flow.py
+++ b/miasm2/analysis/data_flow.py
@@ -639,24 +639,6 @@ def expr_has_mem(expr):
     return expr_test_visit(expr, expr_has_mem_test)
 
 
-def expr_has_call_test(expr, result):
-    if result:
-        # Don't analyse if we already found a candidate
-        return False
-    if expr.is_op() and expr.op.startswith("call"):
-        result.add(expr)
-        return False
-    return True
-
-
-def expr_has_call(expr):
-    """
-    Return True if expr contains at least one "call" operator
-    @expr: Expr instance
-    """
-    return expr_test_visit(expr, expr_has_call_test)
-
-
 class PropagateThroughExprId(object):
     """
     Propagate expressions though ExprId
@@ -669,7 +651,7 @@ class PropagateThroughExprId(object):
         """
         for assignblk in assignblks:
             for dst, src in assignblk.iteritems():
-                if expr_has_call(src):
+                if src.is_function_call():
                     return True
                 if dst.is_mem():
                     return True
@@ -781,7 +763,7 @@ class PropagateThroughExprId(object):
             src = defuse.get_node_target(node)
             if max_expr_depth is not None and len(str(src)) > max_expr_depth:
                 continue
-            if expr_has_call(src):
+            if src.is_function_call():
                 continue
             if node.var.is_mem():
                 continue
@@ -866,7 +848,7 @@ class PropagateExprIntThroughExprId(PropagateThroughExprId):
             src = defuse.get_node_target(node)
             if not src.is_int():
                 continue
-            if expr_has_call(src):
+            if src.is_function_call():
                 continue
             if node.var.is_mem():
                 continue