Return true in case of error, which is what other functions do.

llvm-svn: 41140
This commit is contained in:
Anders Carlsson 2007-08-17 15:44:17 +00:00
parent 81db5acab0
commit a3a9c43837
2 changed files with 5 additions and 5 deletions

View File

@ -47,7 +47,7 @@ Sema::CheckFunctionCall(Expr *Fn,
// Search the KnownFunctionIDs for the identifier.
unsigned i = 0, e = id_num_known_functions;
for (; i != e; ++i) { if (KnownFunctionIDs[i] == FnInfo) break; }
if (i == e) return true;
if (i == e) return false;
// Printf checking.
if (i <= id_vprintf) {
@ -74,7 +74,7 @@ Sema::CheckFunctionCall(Expr *Fn,
FDecl, format_idx, Args, NumArgsInCall);
}
return true;
return false;
}
/// CheckBuiltinCFStringArgument - Checks that the argument to the builtin
@ -90,7 +90,7 @@ bool Sema::CheckBuiltinCFStringArgument(Expr* Arg)
Diag(Arg->getLocStart(),
diag::err_cfstring_literal_not_string_constant,
Arg->getSourceRange());
return false;
return true;
}
const char *Data = Literal->getStrData();
@ -112,7 +112,7 @@ bool Sema::CheckBuiltinCFStringArgument(Expr* Arg)
}
}
return true;
return false;
}
/// CheckPrintfArguments - Check calls to printf (and similar functions) for

View File

@ -561,7 +561,7 @@ ParseCallExpr(ExprTy *fn, SourceLocation LParenLoc,
if (ImplicitCastExpr *IcExpr = dyn_cast<ImplicitCastExpr>(Fn))
if (DeclRefExpr *DRExpr = dyn_cast<DeclRefExpr>(IcExpr->getSubExpr()))
if (FunctionDecl *FDecl = dyn_cast<FunctionDecl>(DRExpr->getDecl()))
if (!CheckFunctionCall(Fn, LParenLoc, RParenLoc, FDecl, Args, NumArgsInCall))
if (CheckFunctionCall(Fn, LParenLoc, RParenLoc, FDecl, Args, NumArgsInCall))
return true;
return new CallExpr(Fn, Args, NumArgsInCall, resultType, RParenLoc);