diff options
author | Brendan Kehoe <brendan@lisa.cygnus.com> | 1997-10-31 23:17:35 +0000 |
---|---|---|
committer | Brendan Kehoe <brendan@gcc.gnu.org> | 1997-10-31 18:17:35 -0500 |
commit | cf9d67e3e8aa596271353f56c49dbe6ebbe3f7ad (patch) | |
tree | dff5b59bd20c5f553511ec9e6abb17639fc45d92 | |
parent | 27ca375af668068978d277ae1d1b92149f121c6a (diff) | |
download | gcc-cf9d67e3e8aa596271353f56c49dbe6ebbe3f7ad.zip gcc-cf9d67e3e8aa596271353f56c49dbe6ebbe3f7ad.tar.gz gcc-cf9d67e3e8aa596271353f56c49dbe6ebbe3f7ad.tar.bz2 |
except.c (push_eh_info): Pass the number of fields - 1 down, not the exact number of fields.
* except.c (push_eh_info): Pass the number of fields - 1 down, not
the exact number of fields.
cuz in finish_builtin_type, its comment sez
LEN is the number of elements
in FIELDS minus one, or put another way, it is the maximum subscript
used in FIELDS.
and its code does
for (i = 0; i < len; i++)
{
layout_type (TREE_TYPE (fields[i]));
DECL_FIELD_CONTEXT (fields[i]) = type;
TREE_CHAIN (fields[i]) = fields[i+1];
}
DECL_FIELD_CONTEXT (fields[i]) = type;
DECL_CLASS_CONTEXT (fields[i]) = type;
thus expecting the final ones to be fields[4], not fields[5] (which is
the actual size from 0, not the last field member)
From-SVN: r16257
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/except.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5ff066a..78df28f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1997-10-31 Brendan Kehoe <brendan@lisa.cygnus.com> + + * except.c (push_eh_info): Pass the number of fields - 1 down, not + the exact number of fields. + Fri Oct 31 01:47:57 1997 Jason Merrill <jason@yorick.cygnus.com> Support for nested exceptions. diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 4d3622b..cb59774 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -342,7 +342,9 @@ push_eh_info () boolean_type_node); fields[4] = build_lang_field_decl (FIELD_DECL, get_identifier ("next"), build_pointer_type (t)); - finish_builtin_type (t, "cp_eh_info", fields, 5, ptr_type_node); + /* N.B.: The fourth field LEN is expected to be + the number of fields - 1, not the total number of fields. */ + finish_builtin_type (t, "cp_eh_info", fields, 4, ptr_type_node); t = build_pointer_type (t); /* And now the function. */ |