From 8bca2287aa0ae827c00388a0463542eb6c072c9e Mon Sep 17 00:00:00 2001 From: Florent Monjalet Date: Sun, 21 Jun 2015 23:20:41 +0200 Subject: cpu: raising an exception when label offset is None This seems more helpful than setting the offset to 0 by default. --- miasm2/core/cpu.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'miasm2/core/cpu.py') 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: -- cgit 1.4.1