From: Bill Wendling Date: Wed, 2 Nov 2011 23:20:58 +0000 (+0000) Subject: An array of chars of length 8 will also cause the stack protector to be inserted X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9c674bb012c23622bd31d5e82cb0baeda9aac3a5;p=oota-llvm.git An array of chars of length 8 will also cause the stack protector to be inserted into the function. Reflect that here so that the array will be placed next to the SP. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143590 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index b052740a1ab..90d35cc76d9 100644 --- a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -92,7 +92,7 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf) { // candidate. I.e., it would trigger the creation of a stack protector. bool MayNeedSP = (AI->isArrayAllocation() || - (TySize > 8 && isa(Ty) && + (TySize >= 8 && isa(Ty) && cast(Ty)->getElementType()->isIntegerTy(8))); StaticAllocaMap[AI] = MF->getFrameInfo()->CreateStackObject(TySize, Align, false, MayNeedSP);