diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-30 14:26:51 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-30 14:26:51 -0800 |
commit | 66e6efea2604be022382921783e32329b6412df8 (patch) | |
tree | 29ba4d0e119f98e2188bf76eac576ab8cf4cf38a /lib/Target/CppBackend/CPPBackend.cpp | |
parent | 1076be8de640976a6886300b0fac96d5e59689b4 (diff) |
fix variable-size alloca cast
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 65b54cbe73..ccde537055 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -1708,7 +1708,7 @@ std::string CppWriter::generateInstruction(const Instruction *I) { if (const ConstantInt *CI = dyn_cast<ConstantInt>(AS)) { Size = Twine(memAlign(BaseSize * CI->getZExtValue())).str(); } else { - Size = '(' + utostr(BaseSize) + '*' + getValueAsStr(AS) + ")|0"; + Size = "((" + utostr(BaseSize) + '*' + getValueAsStr(AS) + ")|0)"; } text = getAssign(iName, Type::getInt32Ty(I->getContext())) + "STACKTOP; STACKTOP = STACKTOP + " + Size + "|0;"; break; |