Checked return warning from coverity
authorRenato Golin <renato.golin@linaro.org>
Tue, 21 Jan 2014 10:24:35 +0000 (10:24 +0000)
committerRenato Golin <renato.golin@linaro.org>
Tue, 21 Jan 2014 10:24:35 +0000 (10:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199716 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/StackProtector.cpp

index f2925ef7712fe3905a4559979ca8f7a3acf3cb5e..349b733418e9bd915838de82c9a6c83359403e51 100644 (file)
@@ -91,8 +91,9 @@ bool StackProtector::runOnFunction(Function &Fn) {
 
   Attribute Attr = Fn.getAttributes().getAttribute(
       AttributeSet::FunctionIndex, "stack-protector-buffer-size");
-  if (Attr.isStringAttribute())
-    Attr.getValueAsString().getAsInteger(10, SSPBufferSize);
+  if (Attr.isStringAttribute() &&
+      Attr.getValueAsString().getAsInteger(10, SSPBufferSize))
+      return false; // Invalid integer string
 
   ++NumFunProtected;
   return InsertStackProtectors();