Bad trees cause NullPointerException

RESOLVED FIXED

Status

P3
normal
RESOLVED FIXED
19 years ago
19 years ago

People

(Reporter: norrisboyd, Assigned: norrisboyd)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

19 years ago
Subject:
             a rhino bug with parsing
        Date:
             Fri, 24 Mar 2000 15:25:58 -0500
       From:
             Kumanan Yogaratnam <kumanan@espial.com>
 Organization:
             Espial Group Inc.
         To:
             norris@netscape.com




hi norris,

the following was reported by our QA dept:

(just so you know, we do not use the optimizer.)

---------------------------------- 8<--------------
Test case for a JavaScript Bug:

The JS engine failed with the following piece of code:

    alert("inside js file");
    var anArray = new Array();
    var pos = 1;
    anArray[0] = 5;
    anArray[1] = 6;

    ++anArray[--pos];
    alert(anArray[pos]);

The above script works fine within netscape, but it throws the following
exception with our browser which uses rhino:

java.lang.NullPointerException
 at org.mozilla.javascript.Interpreter.generateICode(Compiled Code)
 at org.mozilla.javascript.Interpreter.generateICode(Compiled Code)
 at org.mozilla.javascript.Interpreter.generateICode(Compiled Code)
 at org.mozilla.javascript.Interpreter.generateICode(Compiled Code)
 at org.mozilla.javascript.Interpreter.generateICode(Compiled Code)
 at org.mozilla.javascript.Interpreter.generateICodeFromTree(Compiled
Code)
 at
org.mozilla.javascript.Interpreter.generateScriptICode(Interpreter.java)
 at org.mozilla.javascript.Interpreter.compile(Interpreter.java)
 at org.mozilla.javascript.Context.compile(Context.java)
 at org.mozilla.javascript.Context.compile(Context.java)
 at org.mozilla.javascript.Context.compileReader(Context.java)

------------------------ 8<---------------

regards,
kumanan

--
Kumanan Yogaratnam  <mailto:kumanan@espial.com>
Espial Group Inc.
http://www.espial.com
(Assignee)

Comment 1

19 years ago
Created attachment 6908 [details] [diff] [review]
proposed fix
(Assignee)

Comment 2

19 years ago
Checking in IRFactory.java;
/m/pub/mozilla/js/rhino/org/mozilla/javascript/IRFactory.java,v  <--  IRFactory.
java
new revision: 1.10; previous revision: 1.9
done

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