mirror of
https://github.com/lifting-bits/remill
synced 2026-06-21 13:56:07 +00:00
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:
committed by
Kyle Elliott
parent
99d1036f6a
commit
504ba56170
@@ -267,11 +267,11 @@ class ComparisonRunner {
|
|||||||
auto mem_handler =
|
auto mem_handler =
|
||||||
std::make_unique<test_runner::MemoryHandler>(this->endian);
|
std::make_unique<test_runner::MemoryHandler>(this->endian);
|
||||||
auto pc_fetch = [](X86State *st) { return st->gpr.rip.qword; };
|
auto pc_fetch = [](X86State *st) { return st->gpr.rip.qword; };
|
||||||
test_runner::ExecuteLiftedFunction<X86State, uint64_t>(
|
test_runner::ExecuteLiftedFunction<X86State>(f1, insn_length, &func1_state,
|
||||||
f1, insn_length, &func1_state, mem_handler.get(), pc_fetch);
|
mem_handler.get(), pc_fetch);
|
||||||
auto second_handler = std::make_unique<test_runner::MemoryHandler>(
|
auto second_handler = std::make_unique<test_runner::MemoryHandler>(
|
||||||
this->endian, mem_handler->GetUninitializedReads());
|
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);
|
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);
|
void *MissingFunctionStub(const std::string &name);
|
||||||
|
|
||||||
template <typename T, typename P>
|
template <typename T>
|
||||||
void ExecuteLiftedFunction(
|
void ExecuteLiftedFunction(
|
||||||
llvm::Function *func, size_t insn_length, T *state,
|
llvm::Function *func, size_t insn_length, T *state,
|
||||||
test_runner::MemoryHandler *handler,
|
test_runner::MemoryHandler *handler,
|
||||||
|
|||||||
@@ -223,9 +223,9 @@ class TestSpecRunner {
|
|||||||
prec(*mem_hand);
|
prec(*mem_hand);
|
||||||
}
|
}
|
||||||
|
|
||||||
test_runner::ExecuteLiftedFunction<S, uint64_t>(
|
test_runner::ExecuteLiftedFunction<S>(new_func, test.target_bytes.length(),
|
||||||
new_func, test.target_bytes.length(), &st, mem_hand.get(),
|
&st, mem_hand.get(),
|
||||||
[](S *st) { return st->pc.qword; });
|
[](S *st) { return st->pc.qword; });
|
||||||
|
|
||||||
LOG(INFO) << "Pc after execute " << st.pc.qword;
|
LOG(INFO) << "Pc after execute " << st.pc.qword;
|
||||||
test.CheckResultingState(st);
|
test.CheckResultingState(st);
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ class TestSpecRunner {
|
|||||||
prec(*mem_hand);
|
prec(*mem_hand);
|
||||||
}
|
}
|
||||||
|
|
||||||
test_runner::ExecuteLiftedFunction<AArch32State, uint32_t>(
|
test_runner::ExecuteLiftedFunction<AArch32State>(
|
||||||
new_func, test.target_bytes.length(), &st, mem_hand.get(),
|
new_func, test.target_bytes.length(), &st, mem_hand.get(),
|
||||||
[](AArch32State *st) { return st->gpr.r15.dword; });
|
[](AArch32State *st) { return st->gpr.r15.dword; });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user