diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-01-27 19:23:19 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-02-03 14:49:18 +0100 |
| commit | a9f8b5d5939cd4359919f0fef40bdd5c1f9c6441 (patch) | |
| tree | d53cde94fd6528035bb2b1f059d7e6d706202804 /miasm2/core/locationdb.py | |
| parent | 7af9269b2df2898ce50bd03f0d9efc8bd175aa7d (diff) | |
| download | miasm-a9f8b5d5939cd4359919f0fef40bdd5c1f9c6441.tar.gz miasm-a9f8b5d5939cd4359919f0fef40bdd5c1f9c6441.zip | |
Location: known_offset can be None
Diffstat (limited to '')
| -rw-r--r-- | miasm2/core/locationdb.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/miasm2/core/locationdb.py b/miasm2/core/locationdb.py index b6e60794..6655f8ac 100644 --- a/miasm2/core/locationdb.py +++ b/miasm2/core/locationdb.py @@ -252,7 +252,10 @@ class LocationDB(object): # Non-strict mode if name_loc_key is not None: known_offset = self.get_offset_location(name_loc_key) - if known_offset != offset: + if known_offset is None: + if offset is not None: + self.set_location_offset(name_loc_key, offset) + elif known_offset != offset: raise ValueError( "Location with name '%s' already have an offset: 0x%x " "(!= 0x%x)" % (name, offset, known_offset) |