Closed
Bug 118849
Opened 24 years ago
Closed 24 years ago
calling javascript `Function' with bad args crashes browser
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla0.9.8
People
(Reporter: dvrsn, Assigned: brendan)
References
()
Details
(Keywords: crash, js1.5)
Attachments
(2 files, 1 obsolete file)
|
1.85 KB,
text/plain
|
Details | |
|
1.86 KB,
patch
|
timeless
:
review+
shaver
:
superreview+
|
Details | Diff | Splinter Review |
the javascript Function constructor apparently does insufficient argument
checking; if the arguments for formal argument names are not strings (e.g.
they're numbers) an immediate crash results. The functionBody argument does not
have this property.
Comment 1•24 years ago
|
||
Confirming on WinNT. OS: Linux --> All.
In the current JS shell:
js> Function('0')
function anonymous() {
}
js> Function(0);
function anonymous() {
}
js> Function('0', '0')
1: SyntaxError: malformed formal parameter
js> Function(0, 0)
---> CRASH!
cc'ing Brendan on this JS Engine crash.
Will attach stack trace below.
Assignee: rogerl → khanson
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Comment 2•24 years ago
|
||
| Assignee | ||
Comment 3•24 years ago
|
||
Old norris bug, I think. Patch in a second.
/be
| Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Hardware: PC → All
| Assignee | ||
Comment 4•24 years ago
|
||
I'm working on jsfun.c in the same tree as I used to patch bug 118732.
Reviews? Another easy one.
/be
| Assignee | ||
Comment 5•24 years ago
|
||
Attachment #64055 -
Attachment is obsolete: true
Comment 6•24 years ago
|
||
Testcase added to JS testsuite:
mozilla/js/tests/js1_5/Regress/regress-118849.js
Currently passing in Rhino, crashing in Spidermonkey -
Comment 7•24 years ago
|
||
Comment on attachment 64056 [details] [diff] [review]
oops -- last patch was the Call removal one only
Looks good. sr=shaver.
Attachment #64056 -
Flags: superreview+
| Assignee | ||
Comment 8•24 years ago
|
||
Darn, those patches are the same after all. Anyway, still waiting for r=.
/be
Attachment #64056 -
Flags: review+
| Assignee | ||
Comment 9•24 years ago
|
||
Thank you, timeless! I should call you timely.
/be
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 10•24 years ago
|
||
Marking Verified. The above testcase now passes in both the debug
and optimized SpiderMonkey shell -
Status: RESOLVED → VERIFIED
Updated•20 years ago
|
Flags: testcase+
You need to log in
before you can comment on or make changes to this bug.
Description
•