forked from OSchip/llvm-project
[analyzer] DynamicTypeInfo: Avoid putting null regions into dynamic typemap.
Fixes a crash. llvm-svn: 369726
This commit is contained in:
parent
fefdc9371b
commit
0900b77db2
|
@ -93,6 +93,9 @@ ProgramStateRef setDynamicTypeAndCastInfo(ProgramStateRef State,
|
|||
QualType CastFromTy,
|
||||
QualType CastToTy, QualType ResultTy,
|
||||
bool CastSucceeds) {
|
||||
if (!MR)
|
||||
return State;
|
||||
|
||||
if (CastSucceeds)
|
||||
State = State->set<DynamicTypeMap>(MR, ResultTy);
|
||||
|
||||
|
|
|
@ -131,3 +131,8 @@ void evalLogic(const Shape *S) {
|
|||
}
|
||||
} // namespace test_get_as
|
||||
|
||||
namespace crashes {
|
||||
void test_non_reference_null_region_crash(Shape s) {
|
||||
cast<Circle>(s); // no-crash
|
||||
}
|
||||
} // namespace crashes
|
||||
|
|
Loading…
Reference in New Issue