[llvm-branch-commits] [llvm-branch] r84917 - /llvm/branches/Apple/Leela/lib/CodeGen/StackProtector.cpp

Bill Wendling isanbard at gmail.com
Thu Oct 22 17:01:57 PDT 2009


Author: void
Date: Thu Oct 22 19:01:57 2009
New Revision: 84917

URL: http://llvm.org/viewvc/llvm-project?rev=84917&view=rev
Log:
$ svn merge -c 84916 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r84916 into '.':
U    lib/CodeGen/StackProtector.cpp


Modified:
    llvm/branches/Apple/Leela/lib/CodeGen/StackProtector.cpp

Modified: llvm/branches/Apple/Leela/lib/CodeGen/StackProtector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/CodeGen/StackProtector.cpp?rev=84917&r1=84916&r2=84917&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/CodeGen/StackProtector.cpp (original)
+++ llvm/branches/Apple/Leela/lib/CodeGen/StackProtector.cpp Thu Oct 22 19:01:57 2009
@@ -111,11 +111,16 @@
           // protectors.
           return true;
 
-        if (const ArrayType *AT = dyn_cast<ArrayType>(AI->getAllocatedType()))
+        if (const ArrayType *AT = dyn_cast<ArrayType>(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;
+        }
       }
   }
 





More information about the llvm-branch-commits mailing list