diff options
| author | Ajax <commial@gmail.com> | 2018-07-02 19:12:53 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2018-07-03 14:28:18 +0200 |
| commit | d314460a5a19be1f3334baedf0105d9b72fc8620 (patch) | |
| tree | 967c5856dcf37980cf80a2ea48cc7ee0e008e1bd /miasm2/core/cpu.py | |
| parent | 68fac2e86cc61eba9adfe520fa0e04a7e8943450 (diff) | |
| download | miasm-d314460a5a19be1f3334baedf0105d9b72fc8620.tar.gz miasm-d314460a5a19be1f3334baedf0105d9b72fc8620.zip | |
Update symbol_pool's deprecated API -> LocationDB
Diffstat (limited to 'miasm2/core/cpu.py')
| -rw-r--r-- | miasm2/core/cpu.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/miasm2/core/cpu.py b/miasm2/core/cpu.py index 3b36c8d4..dc6fc392 100644 --- a/miasm2/core/cpu.py +++ b/miasm2/core/cpu.py @@ -1022,18 +1022,18 @@ class instruction(object): fixed_expr = {} for exprloc in loc_keys: loc_key = exprloc.loc_key - name = symbols.loc_key_to_name(loc_key) + names = symbols.get_location_names(loc_key) # special symbols - if name == '$': + if '$' in names: fixed_expr[exprloc] = self.get_asm_offset(exprloc) continue - if name == '_': + if '_' in names: fixed_expr[exprloc] = self.get_asm_next_offset(exprloc) continue - if symbols.getby_name(name) is None: + if not names: raise ValueError('Unresolved symbol: %r' % exprloc) - offset = symbols.loc_key_to_offset(loc_key) + offset = symbols.get_location_offset(loc_key) if offset is None: raise ValueError( 'The offset of loc_key "%s" cannot be determined' % name @@ -1534,7 +1534,7 @@ class cls_mn(object): args = [] for d in dst: if isinstance(d, m2_expr.ExprInt): - l = loc_db.getby_offset_create(int(d)) + l = loc_db.get_or_create_offset_location(int(d)) a = m2_expr.ExprId(l.name, d.size) else: |