diff options
author | Jason Merrill <jason@redhat.com> | 2020-01-25 23:09:57 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-01-26 13:41:05 -0500 |
commit | 091fe099ba9093b8577ad4a10b56e18c6ea3daea (patch) | |
tree | 57cf93c8d10aa9c80e46a6c1e56288578f0cdb93 /gcc/tree.c | |
parent | 0f6f39ed733e9462dbeef9dd56d52b21b8cd67c5 (diff) |
checking: avoid verify_type_variant crash on incomplete type.
Here, we end up calling gen_type_die_with_usage for a type that's in the
middle of finish_struct_1, after we set TYPE_NEEDS_CONSTRUCTING on it but
before we copy all the flags to the variants--and, significantly, before we
set its TYPE_SIZE. It seems reasonable to only look at
TYPE_NEEDS_CONSTRUCTING on complete types, since we aren't going to try to
create an object of an incomplete type any other way.
PR c++/92601
* tree.c (verify_type_variant): Only verify TYPE_NEEDS_CONSTRUCTING
of complete types.
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 0ddf002e9eb..298499fe876 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -13881,9 +13881,9 @@ verify_type_variant (const_tree t, tree tv) debug_tree (TYPE_SIZE_UNIT (t)); return false; } + verify_variant_match (TYPE_NEEDS_CONSTRUCTING); } verify_variant_match (TYPE_PRECISION); - verify_variant_match (TYPE_NEEDS_CONSTRUCTING); if (RECORD_OR_UNION_TYPE_P (t)) verify_variant_match (TYPE_TRANSPARENT_AGGR); else if (TREE_CODE (t) == ARRAY_TYPE) |