forked from OSchip/llvm-project
InvalidPtrChecker - don't dereference a dyn_cast<> - use cast<> instead.
Avoid dereferencing a nullptr returned by dyn_cast<>, by using cast<> instead which asserts that the cast is valid.
This commit is contained in:
parent
310736e098
commit
7562f3df89
|
@ -146,7 +146,7 @@ void InvalidPtrChecker::postPreviousReturnInvalidatingCall(
|
|||
State = State->BindExpr(CE, LCtx, RetVal);
|
||||
|
||||
// Remember to this region.
|
||||
const auto *SymRegOfRetVal = dyn_cast<SymbolicRegion>(RetVal.getAsRegion());
|
||||
const auto *SymRegOfRetVal = cast<SymbolicRegion>(RetVal.getAsRegion());
|
||||
const MemRegion *MR =
|
||||
const_cast<MemRegion *>(SymRegOfRetVal->getBaseRegion());
|
||||
State = State->set<PreviousCallResultMap>(FD, MR);
|
||||
|
|
Loading…
Reference in New Issue