Closed Bug 710027 Opened 13 years ago Closed 13 years ago

java.lang.IllegalArgumentException: bad opcode

Categories

(Rhino Graveyard :: Core, defect)

head
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 695354

People

(Reporter: goryachev, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0
Build ID: 20111104165243

Steps to reproduce:

exception running Rhino 1.7R3, works fine in 1.7R2.
attached code illustrates the problem:

// Created by Andy Goryachev <andy@goryachev.com>
import org.mozilla.javascript.Context;
import org.mozilla.javascript.ContextFactory;
import org.mozilla.javascript.ImporterTopLevel;


public class RhinoTest
{
	public static void main(String[] args)
	{
		ImporterTopLevel scope = new ImporterTopLevel();
		Context context = ContextFactory.getGlobal().enterContext();
		
		// fails with Rhino 1.7R3, runs ok with Rhino 1.7R2.
		context.evaluateString(scope, "try{} finally {'';}", "", 1, null);
		
//		Exception in thread "main" java.lang.IllegalArgumentException: bad opcode
//		at org.mozilla.classfile.ClassFileWriter$StackMapTable.execute(ClassFileWriter.java:2271)
//		at org.mozilla.classfile.ClassFileWriter$StackMapTable.executeBlock(ClassFileWriter.java:1739)
//		at org.mozilla.classfile.ClassFileWriter$StackMapTable.executeWorkList(ClassFileWriter.java:1719)
//		at org.mozilla.classfile.ClassFileWriter$StackMapTable.verify(ClassFileWriter.java:1657)
//		at org.mozilla.classfile.ClassFileWriter$StackMapTable.generate(ClassFileWriter.java:1503)
//		at org.mozilla.classfile.ClassFileWriter.stopMethod(ClassFileWriter.java:322)
//		at org.mozilla.javascript.optimizer.BodyCodegen.generateBodyCode(Codegen.java:1399)
//		at org.mozilla.javascript.optimizer.Codegen.generateCode(Codegen.java:341)
//		at org.mozilla.javascript.optimizer.Codegen.compileToClassFile(Codegen.java:196)
//		at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java:105)
//		at org.mozilla.javascript.Context.compileImpl(Context.java:2430)
//		at org.mozilla.javascript.Context.compileString(Context.java:1367)
//		at org.mozilla.javascript.Context.compileString(Context.java:1356)
//		at org.mozilla.javascript.Context.evaluateString(Context.java:1108)
	}
}



Actual results:

exception


Expected results:

should run to completion with no exception

also, Bugzilla interface has no version 1.7R3, listing for HEAD.
possibly related to #695354
Yes, this looks conspicuously like bug #695354, including that I can't reproduce it (your code runs fine for me).

What JDK/JRE version are you using? Can you try with a newer 1.6 and/or 1.7 JDK?
running on 64 bit jdk1.6.0_24, will try with a different version shortly
also fails with:
  32 bit jdk1.6.0_16
  jdk1.7.0_02

Are there any methods/variables I can trace to give you more information?
Another point to consider: it runs fine with the debugger (org.mozilla.javascript.tools.debugger.Dim) attached.
Marking as duplicate of #695354
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.