Checked return warning from coverity

llvm-svn: 199716
This commit is contained in:
Renato Golin 2014-01-21 10:24:35 +00:00
parent 4871067a55
commit e195f9ce15
1 changed files with 3 additions and 2 deletions

View 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();