diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/function.py | 4 | ||||
| -rw-r--r-- | python/mediumlevelil.py | 6 | ||||
| -rw-r--r-- | python/scriptingprovider.py | 8 |
3 files changed, 11 insertions, 7 deletions
diff --git a/python/function.py b/python/function.py index cbbdf9bd..f8aaae44 100644 --- a/python/function.py +++ b/python/function.py @@ -241,10 +241,10 @@ class Variable(object): return self.name def __eq__(self, other): - return self.identifier == other.identifier + return (self.identifier, self.function) == (other.identifier, other.function) def __hash__(self): - return hash(self.identifier) + return hash((self.identifier, self.function)) class ConstantReference(object): diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index 9167212a..6f5515bb 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -39,12 +39,12 @@ class SSAVariable(object): def __eq__(self, other): return ( - (self.var.identifier, self.version) == - (other.var.identifier, other.version) + (self.var, self.version) == + (other.var, other.version) ) def __hash__(self): - return hash((self.var.identifier, self.version)) + return hash((self.var, self.version)) class MediumLevelILLabel(object): diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index 211d2fb7..f9758cc9 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -540,8 +540,12 @@ class PythonScriptingInstance(ScriptingInstance): self.locals["current_address"] = self.active_addr self.locals["here"] = self.active_addr self.locals["current_selection"] = (self.active_selection_begin, self.active_selection_end) - self.locals["current_llil"] = self.active_func.low_level_il - self.locals["current_mlil"] = self.active_func.medium_level_il + if self.active_func == None: + self.locals["current_llil"] = None + self.locals["current_mlil"] = None + else: + self.locals["current_llil"] = self.active_func.low_level_il + self.locals["current_mlil"] = self.active_func.medium_level_il self.interpreter.runsource(code) |
