about summary refs log tree commit diff stats
path: root/miasm2/core/cpu.py
diff options
context:
space:
mode:
authorFlorent Monjalet <florent.monjalet@gmail.com>2015-06-21 23:20:41 +0200
committerFlorent Monjalet <florent.monjalet@gmail.com>2015-06-21 23:28:38 +0200
commit8bca2287aa0ae827c00388a0463542eb6c072c9e (patch)
treeb3ef88e5cbd808ad83ecedf452498e011d075966 /miasm2/core/cpu.py
parentb833f9a1321fb4b5f0e69cecdedf7694f9682da8 (diff)
downloadmiasm-8bca2287aa0ae827c00388a0463542eb6c072c9e.tar.gz
miasm-8bca2287aa0ae827c00388a0463542eb6c072c9e.zip
cpu: raising an exception when label offset is None
This seems more helpful than setting the offset to 0 by default.
Diffstat (limited to 'miasm2/core/cpu.py')
-rw-r--r--miasm2/core/cpu.py5
1 files changed, 2 insertions, 3 deletions
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: