aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-parse.c
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2008-01-04 11:06:34 +0000
committerAndrew Haley <aph@gcc.gnu.org>2008-01-04 11:06:34 +0000
commit5e96e6c04bd61928c4e4a25f1c030ab31976a844 (patch)
tree5ca9d8e9e82f9ece0aab4d35bca5a493ac5af106 /gcc/java/jcf-parse.c
parent6a3d1d4957e60027cf5ab581bf260f50441cdd52 (diff)
downloadgcc-5e96e6c04bd61928c4e4a25f1c030ab31976a844.zip
gcc-5e96e6c04bd61928c4e4a25f1c030ab31976a844.tar.gz
gcc-5e96e6c04bd61928c4e4a25f1c030ab31976a844.tar.bz2
re PR java/17779 (ICE: Seg fault)
2008-01-03 Andrew Haley <aph@redhat.com> PR java/17779 * jcf-parse.c (parse_zip_file_entries): Unset TYPE_ALIAS_SET if we're about to re-layout the type. From-SVN: r131319
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r--gcc/java/jcf-parse.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 67590a4..8aa007c 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -2076,6 +2076,7 @@ parse_zip_file_entries (void)
{
char *class_name = compute_class_name (zdir);
class = lookup_class (get_identifier (class_name));
+ int previous_alias_set = -1;
FREE (class_name);
current_jcf = TYPE_JCF (class);
output_class = current_class = class;
@@ -2085,17 +2086,25 @@ parse_zip_file_entries (void)
gcc_assert (! TYPE_DUMMY (class));
/* This is for a corner case where we have a superclass
- but no superclass fields.
+ but no superclass fields.
This can happen if we earlier failed to lay out this
class because its superclass was still in the process
of being laid out; this occurs when we have recursive
- class dependencies via inner classes. Setting
- TYPE_SIZE to null here causes CLASS_LOADED_P to return
- false, so layout_class() will be called again. */
+ class dependencies via inner classes. We must record
+ the previous alias set and restore it after laying out
+ the class.
+
+ FIXME: this really is a kludge. We should figure out a
+ way to lay out the class properly before this
+ happens. */
if (TYPE_SIZE (class) && CLASSTYPE_SUPER (class)
&& integer_zerop (TYPE_SIZE (class)))
- TYPE_SIZE (class) = NULL_TREE;
+ {
+ TYPE_SIZE (class) = NULL_TREE;
+ previous_alias_set = TYPE_ALIAS_SET (class);
+ TYPE_ALIAS_SET (class) = -1;
+ }
if (! CLASS_LOADED_P (class))
{
@@ -2108,6 +2117,9 @@ parse_zip_file_entries (void)
load_inner_classes (current_class);
}
+ if (previous_alias_set != -1)
+ TYPE_ALIAS_SET (class) = previous_alias_set;
+
if (TYPE_SIZE (current_class) != error_mark_node)
{
parse_class_file ();