analyzer: fix ICE on initializers for unsized array fields [PR96777]
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 25 Aug 2020 13:26:05 +0000 (09:26 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 26 Aug 2020 01:39:32 +0000 (21:39 -0400)
commitd88c8df70342fcd6817e23f243ff38d0fe42fc6b
treebffe72a889c5ed9f48fdfa06fd85b2efe2fa84a8
parentdb0f6efe7a049744b735d8bc69b205a417236c33
analyzer: fix ICE on initializers for unsized array fields [PR96777]

gcc/analyzer/ChangeLog:
PR analyzer/96777
* region-model.h (class compound_svalue): Document that all keys
must be concrete.
(compound_svalue::compound_svalue): Move definition to svalue.cc.
* store.cc (binding_map::apply_ctor_to_region): Handle
initializers for trailing arrays with incomplete size.
* svalue.cc (compound_svalue::compound_svalue): Move definition
here from region-model.h.  Add assertion that all keys are
concrete.

gcc/testsuite/ChangeLog:
PR analyzer/96777
* gcc.dg/analyzer/pr96777.c: New test.
gcc/analyzer/region-model.h
gcc/analyzer/store.cc
gcc/analyzer/svalue.cc
gcc/testsuite/gcc.dg/analyzer/pr96777.c [new file with mode: 0644]