diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-10-29 07:25:31 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-10-29 12:27:41 +0100 |
| commit | 976337d3aaada7adb2e1f2788c8558a024652b2d (patch) | |
| tree | 99527f5ecce66510b009b3e0f81cccc944d5dc8f | |
| parent | 89b7cc0b3bdcff8ef57dba232c9aae544c3ded35 (diff) | |
| download | miasm-976337d3aaada7adb2e1f2788c8558a024652b2d.tar.gz miasm-976337d3aaada7adb2e1f2788c8558a024652b2d.zip | |
Core/asmbloc: Fix get_subcall_instr
| -rw-r--r-- | miasm2/core/asmbloc.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/miasm2/core/asmbloc.py b/miasm2/core/asmbloc.py index 31e4bdd7..9f67747c 100644 --- a/miasm2/core/asmbloc.py +++ b/miasm2/core/asmbloc.py @@ -203,10 +203,14 @@ class asm_bloc(object): def get_subcall_instr(self): if not self.lines: return None - for i in xrange(-1, -1 - self.lines[0].delayslot - 1, -1): + delayslot = self.lines[0].delayslot + end_index = len(self.lines) - 1 + ds_max_index = max(end_index - delayslot, 0) + for i in xrange(end_index, ds_max_index - 1, -1): l = self.lines[i] if l.is_subcall(): return l + return None def get_next(self): for x in self.bto: |