java/1315: Empty inner class initializer crash
bryce@albatross.co.nz
bryce@albatross.co.nz
Wed Dec 20 12:24:00 GMT 2000
>Number: 1315
>Category: java
>Synopsis: Inner class initializer crash
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:18:58 PST 2000
>Closed-Date:
>Last-Modified: Fri Oct 20 03:31:52 PDT 2000
>Originator: Bryce McKinlay
>Release: gcc version 2.96 20000722 (experimental)
>Organization:
>Environment:
any
>Description:
An inner class with an empty instance initializer block that
also has an explicit constructor results in an error:
$ gcj -c Empty.java
Empty.java: In class `Empty$Inner':
Empty.java: In method `Empty$Inner(Empty)':
Empty.java:0: Tree check: expected block, have compound_expr
Empty.java:0: Internal compiler error in fix_constructors, at ./parse.y:8384
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
my line 8384 reads:
compound = add_stmt_to_compound (compound, NULL_TREE,
BLOCK_EXPR_BODY (main_block));
>How-To-Repeat:
Try to compile this test case:
class Empty
{
class Inner
{
{
}
Inner() {}
}
}
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR gcj/293
From: Bryce McKinlay <bryce@albatross.co.nz>
To: java-gnats@sourceware.cygnus.com, apbianco@cygnus.com
Cc:
Subject: Re: gcj/293
Date: Fri, 20 Oct 2000 23:23:51 +1300
> Empty inner class initializer crash
>
Actually the initializer doesn't have to be empty. Any inner class that
has both a default constructor and an initializer block will trigger
this bug. eg:
class InnerInit
{
int a = 5;
class Inner
{
int b;
{
b = a;
}
Inner()
{
System.out.println (b);
}
}
}
regards
[ bryce ]
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=293&database=java
>Unformatted:
More information about the Gcc-prs
mailing list