aboutsummaryrefslogtreecommitdiff
path: root/gcc/analyzer/region-model.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2020-08-25 09:26:05 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2020-08-25 21:39:32 -0400
commitd88c8df70342fcd6817e23f243ff38d0fe42fc6b (patch)
treebffe72a889c5ed9f48fdfa06fd85b2efe2fa84a8 /gcc/analyzer/region-model.h
parentdb0f6efe7a049744b735d8bc69b205a417236c33 (diff)
downloadgcc-d88c8df70342fcd6817e23f243ff38d0fe42fc6b.zip
gcc-d88c8df70342fcd6817e23f243ff38d0fe42fc6b.tar.gz
gcc-d88c8df70342fcd6817e23f243ff38d0fe42fc6b.tar.bz2
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.
Diffstat (limited to 'gcc/analyzer/region-model.h')
-rw-r--r--gcc/analyzer/region-model.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h
index 79d739e..f325a8b 100644
--- a/gcc/analyzer/region-model.h
+++ b/gcc/analyzer/region-model.h
@@ -1109,6 +1109,9 @@ namespace ana {
mapping, but are required to use an svalue, such as when handling
compound assignments and compound return values.
+ All keys within the underlying binding_map are required to be concrete,
+ not symbolic.
+
Instances of this class shouldn't be bound as-is into the store;
instead they should be unpacked. Similarly, they should not be
nested. */
@@ -1150,11 +1153,7 @@ public:
const binding_map *m_map_ptr;
};
- compound_svalue (tree type, const binding_map &map)
- : svalue (calc_complexity (map), type),
- m_map (map)
- {
- }
+ compound_svalue (tree type, const binding_map &map);
enum svalue_kind get_kind () const FINAL OVERRIDE { return SK_COMPOUND; }
const compound_svalue *dyn_cast_compound_svalue () const { return this; }