forked from OSchip/llvm-project
Assert pointer cannot be null; NFC
Klocwork static code analysis exposed this concern: Pointer 'SubExpr' returned from call to getSubExpr() function which may return NULL from 'cast_or_null<Expr>(Operand)', which will be dereferenced in the statement following it Add an assert on SubExpr to make it clear this pointer cannot be null.
This commit is contained in:
parent
9b830c798e
commit
de15979bc3
|
@ -4348,6 +4348,7 @@ llvm::GlobalVariable *MicrosoftCXXABI::getThrowInfo(QualType T) {
|
|||
|
||||
void MicrosoftCXXABI::emitThrow(CodeGenFunction &CGF, const CXXThrowExpr *E) {
|
||||
const Expr *SubExpr = E->getSubExpr();
|
||||
assert(SubExpr && "SubExpr cannot be null");
|
||||
QualType ThrowType = SubExpr->getType();
|
||||
// The exception object lives on the stack and it's address is passed to the
|
||||
// runtime function.
|
||||
|
|
Loading…
Reference in New Issue