diff options
author | David Malcolm <dmalcolm@redhat.com> | 2020-03-10 19:03:37 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2020-03-13 19:04:56 -0400 |
commit | 5c048755ec98645f8436b630df3f9294ca9cbc2a (patch) | |
tree | 6e35062f9015c2bff321865d694370830ffbbda9 /gcc/array-traits.h | |
parent | 5b74dd0a2278365eb562d9d1999c3c11cddb733c (diff) | |
download | gcc-5c048755ec98645f8436b630df3f9294ca9cbc2a.zip gcc-5c048755ec98645f8436b630df3f9294ca9cbc2a.tar.gz gcc-5c048755ec98645f8436b630df3f9294ca9cbc2a.tar.bz2 |
analyzer: handle NOP_EXPR in get_lvalue [PR94099,PR94105]
PR analyzer/94099 and PR analyzer/94105 both report ICEs relating to
calling region_model::get_lvalue on a NOP_EXPR.
PR analyzer/94099's ICE happens when generating a checker_path when
encountering an unhandled tree code (NOP_EXPR) in get_lvalue with a
NULL context (from for_each_state_change).
PR analyzer/94105 ICE happens when handling an ARRAY_REF where the
first operand is a NOP_EXPR: the unhandled tree code gives us
a symbolic_region, but the case for ARRAY_REF assumes we have an
array_region.
This patch fixes the ICEs by handling NOP_EXPR within
region_model::get_lvalue, and bulletproofs both of the above sources
of failure.
gcc/analyzer/ChangeLog:
PR analyzer/94099
PR analyzer/94105
* diagnostic-manager.cc (for_each_state_change): Bulletproof
against errors in get_rvalue by passing a
tentative_region_model_context and rejecting if there's an error.
* region-model.cc (region_model::get_lvalue_1): When handling
ARRAY_REF, handle results of error-handling. Handle NOP_EXPR.
gcc/testsuite/ChangeLog:
PR analyzer/94099
PR analyzer/94105
* gcc.dg/analyzer/pr94099.c: New test.
* gcc.dg/analyzer/pr94105.c: New test.
Diffstat (limited to 'gcc/array-traits.h')
0 files changed, 0 insertions, 0 deletions