"Invalid opcode 196" exception
Brought to you by:
mecki
Attached test throws the following exception. Please
note that code being compiled is using ASM toolkit from
CVS HEAD. http://asm.objectweb.org/
java.lang.RuntimeException: dump(): Invalid opcode 196
at offset 36720
at net.janino.CodeContext.flowAnalysis\(Unknown Source\)
at net.janino.CodeContext.flowAnalysis\(Unknown Source\)
at net.janino.Java$FunctionDeclarator.compile\(Unknown
Source)
at net.janino.Java$ClassDeclaration.compile\(Unknown
Source)
at net.janino.Java$CompilationUnit.compile\(Unknown Source\)
at net.janino.Java$CompilationUnit.compile\(Unknown Source\)
at
org.objectweb.asm.attrs.JaninoTest.main(JaninoTest.java:5217)
Exception in thread "main"
Logged In: YES
user_id=158797
I guess the problem is related to wide offset (196 opcode)...
Logged In: YES
user_id=865893
I can't reproduce this one... On JRE 1.4, I get stack overflow
errors due to the 5000+ string concatenations, and on JRE
1.2.2 I get UTFDataFormatException due to the string
constant longer than 64K.
What exactly is your environment? (JANINO version, JDK
version, etc.)
I renamed your class to "Bug_1032563" and ran:
java net.janino.Compiler -verbose -g -rebuild
Bug_1032563.java
Logged In: YES
user_id=158797
I've picked up Janino 2.0.15 and still can reproduce this bug.
Logged In: YES
user_id=865893
Hi Eugene,
again, what is your environment (JDK, OS, etc.)?
Logged In: YES
user_id=158797
It is windows, JRE 1.4, but issue is totally generic.
Janino just doesn not handle large offsets properly in large
methods. est case is already attached to this bug.
Logged In: YES
user_id=865893
JANINO now unrolls the string concatenation properly and
reduces it to one string constant. That constant, however,
is larger than 64K and is thus split up into several 64K
string constants which are concatenated at run-time.
Logged In: YES
user_id=158797
It seems that problem is still in 2.0.16. I'll try 2.0.17
shortly. Let me know if you need more information.
Logged In: YES
user_id=158797
Just checked. Bug is in 2.0.17 too. Here is
Parser p = new Parser(new Scanner(name, new
StringReader(source)));
return p.parseCompilationUnit().compile(CL,
DebuggingInformation.ALL)[0].toByteArray();
See an attachement for testcase. javac from JDK 1.4 can
compile it without problem. Source has dependency on ASM
toolkit ver. 2.0 (built from CVS HEAD).
Source file that Janino failing to compile
Logged In: YES
user_id=865893
Migrated this ticket to
http://jira.codehaus.org/browse/JANINO-2