aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/class.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2005-10-14 08:46:55 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2005-10-14 08:46:55 +0000
commita93770efeb027ef5c21c5d4f60dae01fc820c4f0 (patch)
tree2185ad06b8afcf4dee078560aaf40bd6d3001429 /gcc/java/class.c
parent2acb1af9aae1057e9a3af38b4c6f4f40f0f79205 (diff)
downloadgcc-a93770efeb027ef5c21c5d4f60dae01fc820c4f0.zip
gcc-a93770efeb027ef5c21c5d4f60dae01fc820c4f0.tar.gz
gcc-a93770efeb027ef5c21c5d4f60dae01fc820c4f0.tar.bz2
re PR java/23620 (Segfault compiling inner interfaces)
PR java/23620 * class.c (make_class): Create empty binfo here. (set_super_info): Only create binfo if we have superclasses. Co-Authored-By: Wil Mahan <wmahan@gmail.com> From-SVN: r105399
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r--gcc/java/class.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c
index b9848d3..eb9ea71 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -319,6 +319,9 @@ make_class (void)
{
tree type;
type = make_node (RECORD_TYPE);
+ /* Unfortunately we must create the binfo here, so that class
+ loading works. */
+ TYPE_BINFO (type) = make_tree_binfo (0);
MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC (type);
return type;
@@ -468,7 +471,8 @@ set_super_info (int access_flags, tree this_class,
if (super_class)
total_supers++;
- TYPE_BINFO (this_class) = make_tree_binfo (total_supers);
+ if (total_supers)
+ TYPE_BINFO (this_class) = make_tree_binfo (total_supers);
TYPE_VFIELD (this_class) = TYPE_VFIELD (object_type_node);
if (super_class)
{