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 <noreply@anthropic.com>
This commit is contained in:
kyle-elliott-tob
2026-02-13 09:11:01 -05:00
committed by Kyle Elliott
parent 99d1036f6a
commit 504ba56170
4 changed files with 8 additions and 8 deletions
@@ -267,11 +267,11 @@ class ComparisonRunner {
auto mem_handler =
std::make_unique<test_runner::MemoryHandler>(this->endian);
auto pc_fetch = [](X86State *st) { return st->gpr.rip.qword; };
test_runner::ExecuteLiftedFunction<X86State, uint64_t>(
f1, insn_length, &func1_state, mem_handler.get(), pc_fetch);
test_runner::ExecuteLiftedFunction<X86State>(f1, insn_length, &func1_state,
mem_handler.get(), pc_fetch);
auto second_handler = std::make_unique<test_runner::MemoryHandler>(
this->endian, mem_handler->GetUninitializedReads());
test_runner::ExecuteLiftedFunction<X86State, uint64_t>(
test_runner::ExecuteLiftedFunction<X86State>(
f2, insn_length, &func2_state, second_handler.get(), pc_fetch);
@@ -106,7 +106,7 @@ CopyFunctionIntoNewModule(llvm::Module *target, const llvm::Function *old_func,
void *MissingFunctionStub(const std::string &name);
template <typename T, typename P>
template <typename T>
void ExecuteLiftedFunction(
llvm::Function *func, size_t insn_length, T *state,
test_runner::MemoryHandler *handler,
+3 -3
View File
@@ -223,9 +223,9 @@ class TestSpecRunner {
prec(*mem_hand);
}
test_runner::ExecuteLiftedFunction<S, uint64_t>(
new_func, test.target_bytes.length(), &st, mem_hand.get(),
[](S *st) { return st->pc.qword; });
test_runner::ExecuteLiftedFunction<S>(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);
+1 -1
View File
@@ -247,7 +247,7 @@ class TestSpecRunner {
prec(*mem_hand);
}
test_runner::ExecuteLiftedFunction<AArch32State, uint32_t>(
test_runner::ExecuteLiftedFunction<AArch32State>(
new_func, test.target_bytes.length(), &st, mem_hand.get(),
[](AArch32State *st) { return st->gpr.r15.dword; });