diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-07-05 11:04:46 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-07-05 13:16:45 +0200 |
| commit | 1d8dc96d6cd82d40e81e8436ed2827916179cd2e (patch) | |
| tree | 8bce7b5aaf34fac81611243688c5a6040536ec81 /miasm2/ir/ir.py | |
| parent | 143196e691a124df3c011167e73a77c1fd503453 (diff) | |
| download | miasm-1d8dc96d6cd82d40e81e8436ed2827916179cd2e.tar.gz miasm-1d8dc96d6cd82d40e81e8436ed2827916179cd2e.zip | |
IR: remove default regs_init for symbexec
Diffstat (limited to 'miasm2/ir/ir.py')
| -rw-r--r-- | miasm2/ir/ir.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/miasm2/ir/ir.py b/miasm2/ir/ir.py index 8ee35ed5..73c184dd 100644 --- a/miasm2/ir/ir.py +++ b/miasm2/ir/ir.py @@ -539,7 +539,19 @@ class IntermediateRepresentation(object): except (ValueError, TypeError): return None - return self.loc_db.get_or_create_offset_location(addr) + return self.loc_db.get_offset_location(addr) + + + def get_or_create_loc_key(self, addr): + """Transforms an ExprId/ExprInt/loc_key/int into a loc_key + If the offset @addr is not in the LocationDB, create it + @addr: an ExprId/ExprInt/loc_key/int""" + + loc_key = self.get_loc_key(addr) + if loc_key is not None: + return loc_key + + return self.loc_db.add_location(offset=int(addr)) def get_block(self, addr): """Returns the irbloc associated to an ExprId/ExprInt/loc_key/int |