summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/StackProtector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/StackProtector.cpp')
-rw-r--r--llvm/lib/CodeGen/StackProtector.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp
index a63ba8c4067..1ffd910604f 100644
--- a/llvm/lib/CodeGen/StackProtector.cpp
+++ b/llvm/lib/CodeGen/StackProtector.cpp
@@ -86,15 +86,15 @@ bool StackProtector::runOnFunction(Function &Fn) {
DT = DTWP ? &DTWP->getDomTree() : nullptr;
TLI = TM->getTargetLowering();
- if (!RequiresStackProtector())
- return false;
-
Attribute Attr = Fn.getAttributes().getAttribute(
AttributeSet::FunctionIndex, "stack-protector-buffer-size");
if (Attr.isStringAttribute() &&
Attr.getValueAsString().getAsInteger(10, SSPBufferSize))
return false; // Invalid integer string
+ if (!RequiresStackProtector())
+ return false;
+
++NumFunProtected;
return InsertStackProtectors();
}
OpenPOWER on IntegriCloud