about summary refs log tree commit diff stats
path: root/miasm2/expression/expression.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2015-04-29 17:07:47 +0200
committerCamille Mougey <commial@gmail.com>2015-04-29 17:07:47 +0200
commit7e9ad339a9a439b083044cbc9c744d50414f35c2 (patch)
treeea9ccf92015c32a79fcd42c09d5c9546efc1deab /miasm2/expression/expression.py
parent8a33f6ce86d4f9818865db44509044c12ddb2844 (diff)
parent758d660f3cbe82c6bd3d947eb5ef9b6f1a3a3f15 (diff)
downloadmiasm-7e9ad339a9a439b083044cbc9c744d50414f35c2.tar.gz
miasm-7e9ad339a9a439b083044cbc9c744d50414f35c2.zip
Merge pull request #154 from carolineLe/dead_code_simp
IR: Improve dead code elimination
Diffstat (limited to 'miasm2/expression/expression.py')
-rw-r--r--miasm2/expression/expression.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/miasm2/expression/expression.py b/miasm2/expression/expression.py
index 154da7cc..2b51ef61 100644
--- a/miasm2/expression/expression.py
+++ b/miasm2/expression/expression.py
@@ -152,6 +152,11 @@ class Expr(object):
     def get_w(self):
         return self.arg.get_w()
 
+    def is_function_call(self):
+        """Returns true if the considered Expr is a function call
+        """
+        return False
+
     def __repr__(self):
         if self._repr is None:
             self._repr = self._exprrepr()
@@ -512,6 +517,9 @@ class ExprAff(Expr):
         else:
             return self._dst.get_w()
 
+    def is_function_call(self):
+        return isinstance(self.src, ExprOp) and self.src.op.startswith('call')
+
     def _exprhash(self):
         return hash((EXPRAFF, hash(self._dst), hash(self._src)))