From 504ba56170360d5d5068886b83e3b533e772d77a Mon Sep 17 00:00:00 2001 From: kyle-elliott-tob Date: Fri, 13 Feb 2026 09:11:01 -0500 Subject: [PATCH] fix: resolve code review findings for PR #749 Remove unused template parameter P from ExecuteLiftedFunction. The P parameter was never used in the function body (even before this PR, the old code hardcoded uint32_t). Now that PC width is dynamically determined from the LLVM function type, P is clearly vestigial. Updated all three call sites to match. Co-Authored-By: Claude Opus 4.6 --- bin/differential_tester_x86/LiftAndCompare.cpp | 6 +++--- test_runner_lib/include/test_runner/TestRunner.h | 2 +- tests/PPC/TestLifting.cpp | 6 +++--- tests/Thumb/TestLifting.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/differential_tester_x86/LiftAndCompare.cpp b/bin/differential_tester_x86/LiftAndCompare.cpp index 9c447bcb..85754434 100644 --- a/bin/differential_tester_x86/LiftAndCompare.cpp +++ b/bin/differential_tester_x86/LiftAndCompare.cpp @@ -267,11 +267,11 @@ class ComparisonRunner { auto mem_handler = std::make_unique(this->endian); auto pc_fetch = [](X86State *st) { return st->gpr.rip.qword; }; - test_runner::ExecuteLiftedFunction( - f1, insn_length, &func1_state, mem_handler.get(), pc_fetch); + test_runner::ExecuteLiftedFunction(f1, insn_length, &func1_state, + mem_handler.get(), pc_fetch); auto second_handler = std::make_unique( this->endian, mem_handler->GetUninitializedReads()); - test_runner::ExecuteLiftedFunction( + test_runner::ExecuteLiftedFunction( f2, insn_length, &func2_state, second_handler.get(), pc_fetch); diff --git a/test_runner_lib/include/test_runner/TestRunner.h b/test_runner_lib/include/test_runner/TestRunner.h index 02a78b1f..944b4961 100644 --- a/test_runner_lib/include/test_runner/TestRunner.h +++ b/test_runner_lib/include/test_runner/TestRunner.h @@ -106,7 +106,7 @@ CopyFunctionIntoNewModule(llvm::Module *target, const llvm::Function *old_func, void *MissingFunctionStub(const std::string &name); -template +template void ExecuteLiftedFunction( llvm::Function *func, size_t insn_length, T *state, test_runner::MemoryHandler *handler, diff --git a/tests/PPC/TestLifting.cpp b/tests/PPC/TestLifting.cpp index e92dd3e9..76d30a5f 100644 --- a/tests/PPC/TestLifting.cpp +++ b/tests/PPC/TestLifting.cpp @@ -223,9 +223,9 @@ class TestSpecRunner { prec(*mem_hand); } - test_runner::ExecuteLiftedFunction( - new_func, test.target_bytes.length(), &st, mem_hand.get(), - [](S *st) { return st->pc.qword; }); + test_runner::ExecuteLiftedFunction(new_func, test.target_bytes.length(), + &st, mem_hand.get(), + [](S *st) { return st->pc.qword; }); LOG(INFO) << "Pc after execute " << st.pc.qword; test.CheckResultingState(st); diff --git a/tests/Thumb/TestLifting.cpp b/tests/Thumb/TestLifting.cpp index 88e25fca..d9303db3 100644 --- a/tests/Thumb/TestLifting.cpp +++ b/tests/Thumb/TestLifting.cpp @@ -247,7 +247,7 @@ class TestSpecRunner { prec(*mem_hand); } - test_runner::ExecuteLiftedFunction( + test_runner::ExecuteLiftedFunction( new_func, test.target_bytes.length(), &st, mem_hand.get(), [](AArch32State *st) { return st->gpr.r15.dword; });