From 4a142eb28942073eb27a112b5ca1cca3f01beb9c Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Fri, 23 Oct 2009 14:19:52 +0000 Subject: Update LLVM to r84949. --- lib/CodeGen/StackProtector.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/StackProtector.cpp') diff --git a/lib/CodeGen/StackProtector.cpp b/lib/CodeGen/StackProtector.cpp index 350bc6e1ade7d..020496933338d 100644 --- a/lib/CodeGen/StackProtector.cpp +++ b/lib/CodeGen/StackProtector.cpp @@ -111,11 +111,16 @@ bool StackProtector::RequiresStackProtector() const { // protectors. return true; - if (const ArrayType *AT = dyn_cast(AI->getAllocatedType())) + if (const ArrayType *AT = dyn_cast(AI->getAllocatedType())) { + // We apparently only care about character arrays. + if (AT->getElementType() != Type::getInt8Ty(AT->getContext())) + continue; + // If an array has more than SSPBufferSize bytes of allocated space, // then we emit stack protectors. if (SSPBufferSize <= TD->getTypeAllocSize(AT)) return true; + } } } -- cgit v1.2.3