[llvm] r199716 - Checked return warning from coverity

Renato Golin renato.golin at linaro.org
Tue Jan 21 02:24:36 PST 2014


Author: rengolin
Date: Tue Jan 21 04:24:35 2014
New Revision: 199716

URL: http://llvm.org/viewvc/llvm-project?rev=199716&view=rev
Log:
Checked return warning from coverity

Modified:
    llvm/trunk/lib/CodeGen/StackProtector.cpp

Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=199716&r1=199715&r2=199716&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StackProtector.cpp (original)
+++ llvm/trunk/lib/CodeGen/StackProtector.cpp Tue Jan 21 04:24:35 2014
@@ -91,8 +91,9 @@ bool StackProtector::runOnFunction(Funct
 
   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();





More information about the llvm-commits mailing list