Closed
Bug 121658
Opened 23 years ago
Closed 23 years ago
too much recursion doesn't unwind
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
mozilla0.9.9
People
(Reporter: timeless, Assigned: brendan)
References
()
Details
(Keywords: js1.5)
Attachments
(1 file, 1 obsolete file)
8.96 KB,
patch
|
brendan
:
review+
shaver
:
superreview+
|
Details | Diff | Splinter Review |
timeless@timeless-bsd:~/mozilla/obj-gtk-i386-unknown-freebsd4.4/dist/bin: ./run-mozilla.sh ./xpcshell Type Manifest File: /home/timeless/mozilla/obj-gtk-i386-unknown-freebsd4.4/dist/bin/components/xpti.dat nsNativeComponentLoader: autoregistering begins. nsNativeComponentLoader: autoregistering succeeded nNCL: registering deferred (0) js> var i=0;function a(){++i;try{arguments.callee()}catch(e){}}; i=0;a(); print (i); //this doesn't work, but i'd like it to typein:1: InternalError: too much recursion js> <brendan> timeless: when errors-as-exceptions went in, someone failed to look at the "too much recursion" cases and fix the control flow For my freebsd system, i expect output of 1000 [which appears to be the value of i after the Error]
Comment 1•23 years ago
|
||
timeless' example above is: var i=0;function a(){++i;try{arguments.callee()}catch(e){}}; i=0; a(); print(i); For my own understanding, note inside the function a(), arguments.callee === a. Therefore the example is equivalent to: var i=0;function a(){++i;try{a()}catch(e){}}; i=0; a(); print(i);
Assignee | ||
Comment 2•23 years ago
|
||
Patch coming right up. /be
Assignee | ||
Comment 3•23 years ago
|
||
Comment 4•23 years ago
|
||
Comment on attachment 66360 [details] [diff] [review] proposed fix r=rogerl. There is one other place where the interpreter simply returns JS_FALSE - line 3617 after CHECK_ACCESS has failed - is that a different scenario?
Attachment #66360 -
Flags: review+
Assignee | ||
Comment 5•23 years ago
|
||
Thanks, fixed that return JS_FALSE to capture false in ok and goto out. /be
Attachment #66360 -
Attachment is obsolete: true
Assignee | ||
Comment 6•23 years ago
|
||
Comment on attachment 66366 [details] [diff] [review] patch revised to fix that return that rogerl caught Recording rogerl's patch. /be
Attachment #66366 -
Flags: review+
Comment on attachment 66366 [details] [diff] [review] patch revised to fix that return that rogerl caught Ja. sr=shaver.
Attachment #66366 -
Flags: superreview+
Assignee | ||
Comment 8•23 years ago
|
||
Fixed, thanks all. /be
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 9•23 years ago
|
||
Testcase added to JS testsuite: mozilla/js/tests/js1_5/Exceptions/regress-121658.js
Comment 10•23 years ago
|
||
Verified FIXED. Before the patch, testcase failed with "InternalError: too much recursion". Now, testcase passes in debug/optimized JS shells on WinNT, Linux, and Mac9.1.
Status: RESOLVED → VERIFIED
Updated•19 years ago
|
Flags: testcase+
You need to log in
before you can comment on or make changes to this bug.
Description
•