forked from OSchip/llvm-project
Add an assert to further check the invariant that a null pointer
corresponds to another argument being valid. This makes it clear that the code is correct despite the PVS-Studio report that a pointer might be dereferenced prior to being checked for whether it is null. It likely is also enough for static analyzers to not flag the code. llvm-svn: 285982
This commit is contained in:
parent
22349ffa5d
commit
3d40284570
|
@ -2539,6 +2539,10 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver,
|
|||
SourceLocation RBracLoc,
|
||||
MultiExprArg ArgsIn,
|
||||
bool isImplicit) {
|
||||
assert((Receiver || SuperLoc.isValid()) && "If the Receiver is null, the "
|
||||
"SuperLoc must be valid so we can "
|
||||
"use it instead.");
|
||||
|
||||
// The location of the receiver.
|
||||
SourceLocation Loc = SuperLoc.isValid()? SuperLoc : Receiver->getLocStart();
|
||||
SourceRange RecRange =
|
||||
|
|
Loading…
Reference in New Issue