From 44851f1b35fe896d0b113e1aea19c423ab902392 Mon Sep 17 00:00:00 2001 From: Miical <879754743@qq.com> Date: Sat, 14 Sep 2024 18:27:36 +0800 Subject: [PATCH] Add force jump when PC exception occurs in Trace branch --- tests/uFTB-with-ftq/env/executor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/uFTB-with-ftq/env/executor.py b/tests/uFTB-with-ftq/env/executor.py index 821b1d0..bc6dcd3 100644 --- a/tests/uFTB-with-ftq/env/executor.py +++ b/tests/uFTB-with-ftq/env/executor.py @@ -43,7 +43,8 @@ class Executor: inst_len = self._current_branch["pc"] - self._current_pc self._current_pc = self._current_branch["pc"] - elif (self._current_branch["pc"] == self._current_pc): + elif (self._current_branch["pc"] <= self._current_pc): + # When current pc < next branch pc, force to execute next branch inst_len = Executor.branch_inst_len(self._current_branch) self._current_pc = self._current_branch["target"] if self._current_branch["taken"] \ else self._current_pc + inst_len