diff --git a/manticore/native/cpu/abstractcpu.py b/manticore/native/cpu/abstractcpu.py index 4e7aa060a..f041e2f01 100644 --- a/manticore/native/cpu/abstractcpu.py +++ b/manticore/native/cpu/abstractcpu.py @@ -950,19 +950,21 @@ def execute(self): """ Decode, and execute one instruction pointed by register PC """ - if issymbolic(self.PC): + curpc = self.PC + if issymbolic(curpc): raise ConcretizeRegister(self, "PC", policy="ALL") - if not self.memory.access_ok(self.PC, "x"): - raise InvalidMemoryAccess(self.PC, "x") + if not self.memory.access_ok(curpc, "x"): + raise InvalidMemoryAccess(curpc, "x") - self._publish("will_decode_instruction", self.PC) + self._publish("will_decode_instruction", curpc) - insn = self.decode_instruction(self.PC) + insn = self.decode_instruction(curpc) self._last_pc = self.PC - self._publish("will_execute_instruction", self.PC, insn) + self._publish("will_execute_instruction", self._last_pc, insn) # FIXME (theo) why just return here? + # hook changed PC, so we trust that there is nothing more to do if insn.address != self.PC: return