Ignore stack adjustment for ebp-based variables. The TargetX8632 class maintains a "current stack adjustment" during a push sequence, so that pushing or otherwise accessing stack locations during a function arg push sequence can use the right esp offset. This adjustment should only be used for esp-based frames, but it was being used for ebp-based frames as well, causing the wrong stack-based arguments to be pushed. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3878 R=jvoung@chromium.org Review URL: https://codereview.chromium.org/331743002
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp index 81973d0..46a587f 100644 --- a/src/IceTargetLoweringX8632.cpp +++ b/src/IceTargetLoweringX8632.cpp
@@ -390,7 +390,9 @@ } Str << InstX8632::getWidthString(Var->getType()); Str << " [" << getRegName(getFrameOrStackReg(), IceType_i32); - int32_t Offset = Var->getStackOffset() + getStackAdjustment(); + int32_t Offset = Var->getStackOffset(); + if (!hasFramePointer()) + Offset += getStackAdjustment(); if (Offset) { if (Offset > 0) Str << "+";