aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-strlen.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2020-08-31 09:00:23 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2020-08-31 18:28:59 -0400
commit18056e45db1c75aa209fa9a756395ddceb867a88 (patch)
tree0a2207a90419a73af0bcf0086cb1c3a6a45d35a7 /gcc/tree-ssa-strlen.c
parent73a2b8dd17dbc02c0c7e6286e90f17833aa50906 (diff)
downloadgcc-18056e45db1c75aa209fa9a756395ddceb867a88.zip
gcc-18056e45db1c75aa209fa9a756395ddceb867a88.tar.gz
gcc-18056e45db1c75aa209fa9a756395ddceb867a88.tar.bz2
analyzer: fix ICE on unknown index in CONSTRUCTOR [PR96860]
PR analyzer/96860 reports an ICE inside CONSTRUCTOR-handling with --param analyzer-max-svalue-depth=0 when attempting to build a binding_map for the CONSTRUCTOR's values. The issue is that when handling (index, value) pairs for initializing an array, the index values for the elements exceeds the svalue complexity limit, and the index is thus treated as unknown, leading to a symbolic rather than concrete offset for each array element. This patch updates the CONSTRUCTOR-handling code so that it can fail, returning an unknown value for the overall value of the constructor for this case, fixing the ICE. gcc/analyzer/ChangeLog: PR analyzer/96860 * region.cc (decl_region::get_svalue_for_constructor): Support apply_ctor_to_region failing. * store.cc (binding_map::apply_ctor_to_region): Add failure handling. (binding_map::apply_ctor_val_to_range): Likewise. (binding_map::apply_ctor_pair_to_child_region): Likewise. Replace assertion that child_base_offset is not symbolic with error handling. * store.h (binding_map::apply_ctor_to_region): Convert return type from void to bool. (binding_map::apply_ctor_val_to_range): Likewise. (binding_map::apply_ctor_pair_to_child_region): Likewise. gcc/testsuite/ChangeLog: PR analyzer/96860 * gcc.dg/analyzer/pr96860-1.c: New test. * gcc.dg/analyzer/pr96860-2.c: New test.
Diffstat (limited to 'gcc/tree-ssa-strlen.c')
0 files changed, 0 insertions, 0 deletions