-
- Downloads
analyzer: fix ICE on failed casts [PR 93777]
PR analyzer/93777 reports ICEs in a Fortran and C++ case 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. gcc/analyzer/ChangeLog: PR analyzer/93777 * 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. gcc/testsuite/ChangeLog: PR analyzer/93777 * g++.dg/analyzer/pr93777.C: New test. * gfortran.dg/analyzer/pr93777.f90: New test.
Showing
- gcc/analyzer/ChangeLog 8 additions, 0 deletionsgcc/analyzer/ChangeLog
- gcc/analyzer/region-model.cc 3 additions, 4 deletionsgcc/analyzer/region-model.cc
- gcc/testsuite/ChangeLog 6 additions, 0 deletionsgcc/testsuite/ChangeLog
- gcc/testsuite/g++.dg/analyzer/pr93777.C 1 addition, 0 deletionsgcc/testsuite/g++.dg/analyzer/pr93777.C
- gcc/testsuite/gfortran.dg/analyzer/pr93777.f90 22 additions, 0 deletionsgcc/testsuite/gfortran.dg/analyzer/pr93777.f90
Loading
Please register or sign in to comment