blowout on out-of-bounds array invocation as function

VERIFIED FIXED in 1.5R3

Status

defect
VERIFIED FIXED
18 years ago
16 years ago

People

(Reporter: rokicki, Assigned: norrisboyd)

Tracking

other
1.5R3
x86
Windows NT

Details

Reporter

Description

18 years ago
E:\p4test\main\dev>java -version
java version "1.2.2"
Java HotSpot(TM) Server VM (2.0rc1, mixed mode, build I)

E:\p4test\main\dev>java -jar e:/rhino/js.jar
js> "3"[5]()
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
        at org.mozilla.javascript.Interpreter.getString(Interpreter.java:1132)
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1942)
        at org.mozilla.javascript.InterpretedScript.call(InterpretedScript.java:
68)
        at org.mozilla.javascript.InterpretedScript.exec(InterpretedScript.java:
59)
        at org.mozilla.javascript.Context.evaluateReader(Context.java:773)
        at org.mozilla.javascript.tools.shell.Main.evaluateReader(Main.java:293)

        at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:217)
        at org.mozilla.javascript.tools.shell.Main.exec(Main.java:104)
        at org.mozilla.javascript.tools.shell.Main.main(Main.java:66)

Comment 1

18 years ago
I'm also seeing this. Compare SpiderMonkey:

js>  "3"[5]();
1: TypeError: "3"[5] is not a function

Comment 2

18 years ago
Testcase added to JS testsuite:

          mozilla/js/tests/js1_5/Regress/regress-114493.js
Assignee

Comment 3

18 years ago
Fixed:

Checking in Interpreter.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Interpreter.java,v  <--  In
terpreter.java
new revision: 1.61; previous revision: 1.60
done
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 4

18 years ago
Verified FIXED. The construct produces a TypeError instead of crashing.
The testcase above now passes in both the rhino and rhinoi shells.
Status: RESOLVED → VERIFIED

Comment 5

16 years ago
Targeting as resolved against 1.5R3
Target Milestone: --- → 1.5R3
You need to log in before you can comment on or make changes to this bug.