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 1363204d9805ccc6ca61daecb0ee3e476d28bc5f..9d845cdf80e6d9e9e3df3ede52fdbd16d9a6956d 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp @@ -893,8 +893,10 @@ MemOperand &AArch64CGFunc::ConstraintOffsetToSafeRegion(uint32 bitLen, const Mem hashMemOpndTable.erase(memOpnd); } int32 offsetValue = static_cast(memOpnd.GetOffsetImmediate()->GetOffsetValue()); - int32 multiplier = (offsetValue / k512BitSizeInt) + static_cast(offsetValue % k512BitSizeInt > k256BitSizeInt); - int32 addMount = multiplier * k512BitSizeInt; + int32 val256 = k256BitSizeInt; /* const val is unsigned */ + int32 val512 = k512BitSizeInt; + int32 multiplier = (offsetValue / val512) + static_cast(offsetValue % val512 > val256); + int32 addMount = multiplier * val512; int32 newOffset = offsetValue - addMount; RegOperand *baseReg = memOpnd.GetBaseRegister(); ImmOperand &immAddMount = CreateImmOperand(addMount, k64BitSize, true);