Javascript compiler (JSC) is broken in rhino1_6R2

RESOLVED FIXED

Status

Rhino
Compiler
--
critical
RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: Eric Fu, Assigned: Igor Bukanov)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

Running the example in the documentation and got the following error. It works
on previous versions.

C:\Scripting\rhino1_6R2\test>java -classpath .;..\js.jar
org.mozilla.javascript.tools.jsc.Main -extends ScriptIntf Script1.js
Exception in thread "main" java.lang.IllegalStateException: Stack underflow: -1
        at org.mozilla.classfile.ClassFileWriter.badStack(ClassFileWriter.java:1476)
        at org.mozilla.classfile.ClassFileWriter.add(ClassFileWriter.java:753)
        at
org.mozilla.javascript.JavaAdapter.generateEmptyCtor(JavaAdapter.java:624)
        at
org.mozilla.javascript.JavaAdapter.createAdapterCode(JavaAdapter.java:350)
        at
org.mozilla.javascript.optimizer.ClassCompiler.compileToClassFiles(ClassCompiler.java:194)
        at org.mozilla.javascript.tools.jsc.Main.processSource(Main.java:267)
        at org.mozilla.javascript.tools.jsc.Main.main(Main.java:70)


Reproducible: Always

Steps to Reproduce:
1. java -classpath .;..\js.jar org.mozilla.javascript.tools.jsc.Main -extends
ScriptIntf Script1.js



Actual Results:  
Exception in thread "main" java.lang.IllegalStateException: Stack underflow: -1
        at org.mozilla.classfile.ClassFileWriter.badStack(ClassFileWriter.java:1476)
        at org.mozilla.classfile.ClassFileWriter.add(ClassFileWriter.java:753)
        at
org.mozilla.javascript.JavaAdapter.generateEmptyCtor(JavaAdapter.java:624)
        at
org.mozilla.javascript.JavaAdapter.createAdapterCode(JavaAdapter.java:350)
        at
org.mozilla.javascript.optimizer.ClassCompiler.compileToClassFiles(ClassCompiler.java:194)
        at org.mozilla.javascript.tools.jsc.Main.processSource(Main.java:267)
        at org.mozilla.javascript.tools.jsc.Main.main(Main.java:70)


Expected Results:  
NO errors.
(Assignee)

Comment 1

13 years ago
Created attachment 197892 [details] [diff] [review]
Fix
(Assignee)

Comment 2

13 years ago
I committed the fix.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.