diff options
author | Nathan Sidwell <nathan@gcc.gnu.org> | 2002-12-30 12:46:13 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2002-12-30 12:46:13 +0000 |
commit | 5a5cccaa4e00fd06fd8e8bf4e9f731dbda799dd3 (patch) | |
tree | eda1a7b14bc3ca30755dbcbff392ba3ee7f3c334 | |
parent | 8b5d67e116b5698d541e351859d12e8f0bf03345 (diff) | |
download | gcc-5a5cccaa4e00fd06fd8e8bf4e9f731dbda799dd3.zip gcc-5a5cccaa4e00fd06fd8e8bf4e9f731dbda799dd3.tar.gz gcc-5a5cccaa4e00fd06fd8e8bf4e9f731dbda799dd3.tar.bz2 |
re PR c++/9054 (segfault on legal code with option -fdump-translation-unit)
PR c++/9054
* class.c (layout_class_type): Set DECL_CONTEXT of type for base.
* dump.c (cp_dump_tree, RECORD_TYPE): Deal with type for base types.
From-SVN: r60627
-rw-r--r-- | gcc/cp/class.c | 1 | ||||
-rw-r--r-- | gcc/cp/dump.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 32f49a7..85d6d2a 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -5161,6 +5161,7 @@ layout_class_type (tree t, tree *virtuals_p) /* Record the base version of the type. */ CLASSTYPE_AS_BASE (t) = base_t; + TYPE_CONTEXT (base_t) = t; } else CLASSTYPE_AS_BASE (t) = t; diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c index fa55833..da207d3 100644 --- a/gcc/cp/dump.c +++ b/gcc/cp/dump.c @@ -265,6 +265,14 @@ cp_dump_tree (dump_info, t) return 1; } + /* Is it a type used as a base? */ + if (TYPE_CONTEXT (t) && TREE_CODE (TYPE_CONTEXT (t)) == TREE_CODE (t) + && CLASSTYPE_AS_BASE (TYPE_CONTEXT (t)) == t) + { + dump_child ("bfld", TYPE_CONTEXT (t)); + return 1; + } + dump_child ("vfld", TYPE_VFIELD (t)); if (CLASSTYPE_TEMPLATE_SPECIALIZATION(t)) dump_string(di, "spec"); |