diff options
| -rw-r--r-- | miasm2/core/asmbloc.py | 2 | ||||
| -rw-r--r-- | miasm2/core/cpu.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/miasm2/core/asmbloc.py b/miasm2/core/asmbloc.py index a5dd8142..1a2d7a91 100644 --- a/miasm2/core/asmbloc.py +++ b/miasm2/core/asmbloc.py @@ -292,6 +292,8 @@ class asm_symbol_pool: Note that there is a special case when the offset is a list it happens when offsets are recomputed in resolve_symbol* """ + if label is None: + raise ValueError('label should not be None') if not label.name in self._name2label: raise ValueError('label %s not in symbol pool' % label) if offset is not None and offset in self._offset2label: diff --git a/miasm2/core/cpu.py b/miasm2/core/cpu.py index efb511ce..c42de507 100644 --- a/miasm2/core/cpu.py +++ b/miasm2/core/cpu.py @@ -958,9 +958,8 @@ class instruction(object): if not name in symbols: continue if symbols[name].offset is None: - default_size = self.get_symbol_size(x, symbols) - # default value - value = m2_expr.ExprInt_fromsize(default_size, 0) + raise ValueError('The offset of label "%s" cannot be ' + 'determined' % name) else: size = x.size if size is None: |