]> granicus.if.org Git - llvm/commitdiff
[CodeGen] stop short-circuiting the SSP code for sspstrong.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Tue, 20 Sep 2016 21:30:01 +0000 (21:30 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Tue, 20 Sep 2016 21:30:01 +0000 (21:30 +0000)
This check caused us to skip adding layout information for calls to
alloca in sspreq/sspstrong mode. We check properly for sspstrong later
on (and add the correct layout info when doing so), so removing this
shouldn't hurt.

No test is included, since testing this using lit seems to require
checking for exact offsets in asm, which is something that the lit tests
for this avoid. If someone cares deeply, I'm happy to write a unittest
or something to cover this, but that feels like overkill.

Patch by Daniel Micay.

Differential Revision: https://reviews.llvm.org/D22714

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282022 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/StackProtector.cpp

index fa0611391f62c29e42982cdf02fddc9e03197720..c2c010a29d44b40f88957ddfa5cc57903999792d 100644 (file)
@@ -236,11 +236,6 @@ bool StackProtector::RequiresStackProtector() {
     for (const Instruction &I : BB) {
       if (const AllocaInst *AI = dyn_cast<AllocaInst>(&I)) {
         if (AI->isArrayAllocation()) {
-          // SSP-Strong: Enable protectors for any call to alloca, regardless
-          // of size.
-          if (Strong)
-            return true;
-
           if (const auto *CI = dyn_cast<ConstantInt>(AI->getArraySize())) {
             if (CI->getLimitedValue(SSPBufferSize) >= SSPBufferSize) {
               // A call to alloca with size >= SSPBufferSize requires