From 63dc622d9da344105c1ffbe48f7ca286f49e177f Mon Sep 17 00:00:00 2001 From: redthing1 Date: Fri, 6 Feb 2026 12:09:11 -0800 Subject: [PATCH] SleighLifter: fix ppc hypercall memory passing --- lib/BC/SleighLifter.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/BC/SleighLifter.cpp b/lib/BC/SleighLifter.cpp index d26331a2..3d7b20b5 100644 --- a/lib/BC/SleighLifter.cpp +++ b/lib/BC/SleighLifter.cpp @@ -1422,17 +1422,20 @@ class SleighLifter::PcodeToLLVMEmitIntoBlock { DLOG(INFO) << "Invoking syscall"; const auto mem_ptr_ref = LoadMemoryPointerRef(bldr.GetInsertBlock()); + auto mem_ptr = + bldr.CreateLoad(insn_lifter_parent.GetMemoryType(), mem_ptr_ref); // Get a LLVM value for the sync hyper call enumeration. auto hyper_call_int = static_cast(SyncHyperCall::Name::kPPCSysCall); auto hyper_call = llvm::ConstantInt::get( llvm::IntegerType::get(this->context, 32), hyper_call_int); - std::array args = {state_pointer, mem_ptr_ref, + std::array args = {state_pointer, mem_ptr, hyper_call}; - bldr.CreateCall(insn_lifter_parent.GetIntrinsicTable()->sync_hyper_call, - args); + auto new_mem_ptr = bldr.CreateCall( + insn_lifter_parent.GetIntrinsicTable()->sync_hyper_call, args); + bldr.CreateStore(new_mem_ptr, mem_ptr_ref); return kLiftedInstruction; }