This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
almost a cosmetic bug
- To: Java Discuss List <java at gcc dot gnu dot org>
- Subject: almost a cosmetic bug
- From: Olivier <olivier at zipworld dot com dot au>
- Date: Mon, 12 Feb 2001 09:29:20 +1100
- Reply-To: Java Discuss List <java at gcc dot gnu dot org>
I have found a strange behavior of gcj on erroneous code which should
just output a syntax error message.
This is with the CVS head of Janury 31.
Basically the compiler segfault rather than reporting a syntax error
message if it tries to set a variable from the return value of a method call
which is erroneously written.
Confused? Here an example:
Test test = new Test ();
boolean b;
b = test.result(); // ok, compile fine
test.result(); // ok, compile fine
test.result ; // ok, report a syntax error
b = test.result ; // WRONG, compiler segfault
gcj --main=Test -o Test Test.java
Test.java: In class `Test':
Test.java: In method `Test.main(java.lang.String[])':
Test.java:9: Internal error: Segmentation fault.
Please submit a full bug report, with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
This is the code:
//////////////////////////////////////////////////////////////////////
public class Test
{
public static void main (String[] args)
{
boolean b = false;
Test test = new Test ();
b = test.result; // segfault
System.out.println (b);
}
public boolean result () {
return true;
}
}
//////////////////////////////////////////////////////////////////////
Olivier
--
Olivier Louchart-Fletcher
Email: olivier@zipworld.com.au