-
Bug
-
Resolution: Fixed
-
P2
-
1.1
-
1.1
-
unknown
-
solaris_2.5.1
-
Not verified
(This bug was reported by JDK 1.1 EA site: Ignite Technologies -- Warner Losh)
If you give it a switch statement that covers a larger range of
values (our example covers a range of 99999000, which is << 2^31),
then javac will fail with an OutOfMemoryError exception. The 1.0.2
JDK javac compiles the following example without complaint.
% cat Foo.java
class Foo {
public void bar(int ch) {
switch ( ch ) {
case 1: break;
case 99999001: break;
}}}
% /opt/jdk-1.1A/java/bin/javac Foo.java
java.lang.OutOfMemoryError
at sun.tools.asm.SwitchData.initTableCase(SwitchData.java:84)
at sun.tools.tree.SwitchStatement.code(SwitchStatement.java:179)
at sun.tools.javac.SourceField.code(SourceField.java:621)
at sun.tools.javac.SourceField.code(SourceField.java:583)
at sun.tools.javac.SourceClass.compileClass(SourceClass.java:965)
at sun.tools.javac.SourceClass.compile(SourceClass.java:916)
at sun.tools.javac.Main.compile(Main.java:267)
at sun.tools.javac.Main.main(Main.java:375)
error: An error has occurred in the compiler; please file a bug report (###@###.###).
If you give it a switch statement that covers a larger range of
values (our example covers a range of 99999000, which is << 2^31),
then javac will fail with an OutOfMemoryError exception. The 1.0.2
JDK javac compiles the following example without complaint.
% cat Foo.java
class Foo {
public void bar(int ch) {
switch ( ch ) {
case 1: break;
case 99999001: break;
}}}
% /opt/jdk-1.1A/java/bin/javac Foo.java
java.lang.OutOfMemoryError
at sun.tools.asm.SwitchData.initTableCase(SwitchData.java:84)
at sun.tools.tree.SwitchStatement.code(SwitchStatement.java:179)
at sun.tools.javac.SourceField.code(SourceField.java:621)
at sun.tools.javac.SourceField.code(SourceField.java:583)
at sun.tools.javac.SourceClass.compileClass(SourceClass.java:965)
at sun.tools.javac.SourceClass.compile(SourceClass.java:916)
at sun.tools.javac.Main.compile(Main.java:267)
at sun.tools.javac.Main.main(Main.java:375)
error: An error has occurred in the compiler; please file a bug report (###@###.###).