Chromium Code Reviews| Index: src/IceCfg.cpp |
| diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp |
| index 3fe37f3c87eba936ee72bbf83c23955ec137db9f..9e2131bfcc5ac1eb45215319e1bc04ed5e563d55 100644 |
| --- a/src/IceCfg.cpp |
| +++ b/src/IceCfg.cpp |
| @@ -484,8 +484,14 @@ void Cfg::sortAndCombineAllocas(CfgVector<Inst *> &Allocas, |
| } else { |
| // Addressing is relative to the stack pointer or to a user pointer. Add |
| // the offset before adding the size of the object, because it grows |
| - // upwards from the stack pointer. |
| - Offsets.push_back(CurrentOffset); |
| + // upwards from the stack pointer. Besides, if the addressing is relative |
|
Jim Stichnoth
2015/11/23 19:36:20
s/Besides/In addition/ ?
John
2015/11/23 19:42:36
Done.
|
| + // to the stack pointer, we need to add the pre-computed max out args size |
| + // bytes. |
| + const uint32_t OutArgsOffsetOrZero = |
| + (BaseVariableType == BVT_StackPointer) |
| + ? getTarget()->maxOutArgsSizeBytes() |
| + : 0; |
| + Offsets.push_back(CurrentOffset + OutArgsOffsetOrZero); |
| } |
| // Update the running offset of the fused alloca region. |
| CurrentOffset += Size; |