diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp index 22a14dbb184703a7b9c1e4bd262648471990cbd5..9235cd7f25fc2808132f60f646e5cebc8c4a211b 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp @@ -6551,7 +6551,7 @@ void AArch64CGFunc::CreateCallStructParamMemcpy(const MIRSymbol *sym, RegOperand if (sym != nullptr) { if (sym->GetStorageClass() == kScGlobal || sym->GetStorageClass() == kScExtern) { - StImmOperand &stopnd = CreateStImmOperand(*sym, 0, 0); + StImmOperand &stopnd = CreateStImmOperand(*sym, fromOffset, 0); AArch64RegOperand &staddropnd = static_cast(CreateRegisterOperandOfType(PTY_u64)); SelectAddrof(staddropnd, stopnd); opndVec.push_back(&staddropnd); /* param 1 */ @@ -6560,7 +6560,7 @@ void AArch64CGFunc::CreateCallStructParamMemcpy(const MIRSymbol *sym, RegOperand AArch64SymbolAlloc *symloc = static_cast(GetMemlayout()->GetSymAllocInfo(sym->GetStIndex())); AArch64RegOperand *baseOpnd = static_cast(GetBaseReg(*symloc)); int32 stoffset = GetBaseOffset(*symloc); - AArch64ImmOperand *offsetOpnd1 = &CreateImmOperand(stoffset, k64BitSize, false); + AArch64ImmOperand *offsetOpnd1 = &CreateImmOperand(stoffset + fromOffset, k64BitSize, false); GetCurBB()->AppendInsn(GetCG()->BuildInstruction(MOP_xaddrri12, *parm1Reg, *baseOpnd, *offsetOpnd1)); if (sym->GetStorageClass() == kScFormal) { MemOperand *ldmopnd =