[PATCH] analyzer: fix ICE on failed casts [PR 93777]
PR analyzer/93777 reports ICEs in Fortran and C++ cases involving
a cast of a NULL pointer to a REFERENCE_TYPE.
In both cases the call to build_cast fails and returns a NULL type, but
region_model::maybe_cast_1 asserts that a non-NULL type was returned.
This patch fixes the ICEs by converting the assertion to a conditional.
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
I think I have permission to self-approve the analyzer part and the C++
Is the Fortran testcase OK for master?
* region-model.cc (region_model::maybe_cast_1): Replace assertion
that build_cast returns non-NULL with a conditional, falling
through to the logic which returns a new unknown value of the
desired type if it fails.