Closed
Bug 346773
Opened 18 years ago
Closed 18 years ago
Crash with misplaced braces in function
Categories
(Core :: JavaScript Engine, defect, P1)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla1.8.1beta2
People
(Reporter: Waldo, Assigned: mrbkap)
References
Details
(Keywords: crash, verified1.8.1)
Attachments
(2 files)
1.66 KB,
patch
|
brendan
:
review+
beltzner
:
approval1.8.1+
|
Details | Diff | Splinter Review |
2.92 KB,
patch
|
mrbkap
:
review+
dbaron
:
superreview+
dbaron
:
approval1.8.1+
|
Details | Diff | Splinter Review |
js> var it = {foo:"5"}; js> it.__iterator__ = function(valsOnly) { var gen = function() { for (var i = 0; i < keys.length; i++) { if (valsOnly) yield vals[i]; else yield [keys[i], vals[i]]; } return gen(); ./js: line 2: 16626 Segmentation fault /home/jwalden/moz/trees/js/mozilla/js/src/Linux_All_DBG.OBJ/js
Assignee | ||
Comment 1•18 years ago
|
||
Obvious copy/paste error.
Assignee | ||
Updated•18 years ago
|
OS: Linux → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → mozilla1.8.1beta2
Comment 2•18 years ago
|
||
Comment on attachment 231531 [details] [diff] [review] Fix copy-paste error Oh, for type-safe format strings! /be
Attachment #231531 -
Flags: review?(brendan)
Attachment #231531 -
Flags: review+
Attachment #231531 -
Flags: approval1.8.1?
Assignee | ||
Comment 3•18 years ago
|
||
Checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Seems like you could have some DEBUG-only code (along with the existing assertions in JS_NewRuntime) that has assertions to check for this problem.
Comment 5•18 years ago
|
||
Comment on attachment 231531 [details] [diff] [review] Fix copy-paste error a=drivers, please land this on the MOZILLA_1_8_BRANCH.
Attachment #231531 -
Flags: approval1.8.1? → approval1.8.1+
Comment 6•18 years ago
|
||
(In reply to comment #4) > Seems like you could have some DEBUG-only code (along with the existing > assertions in JS_NewRuntime) that has assertions to check for this problem. This is a DEBUG-only change, so dbaron feel free to approve for 1.8.1 as well as sr+ -- thanks. /be
Attachment #231544 -
Flags: superreview?(dbaron)
Attachment #231544 -
Flags: review?(mrbkap)
Comment on attachment 231544 [details] [diff] [review] how about this? >+ * error names enumerated in jscntxt.c. It's not a compiletime check, I'm skeptical of compiletime being one word. Perhaps hyphenate? I wanted to use existing style of the JS engine to point out some nits, but apparently there is little consistency in js/src/ for choosing between prefix and postfix increment or decrement when it doesn't matter. (I prefer prefix.)
Attachment #231544 -
Flags: superreview?(dbaron) → superreview+
Attachment #231544 -
Flags: approval1.8.1+
Comment 8•18 years ago
|
||
(In reply to comment #7) > (From update of attachment 231544 [details] [diff] [review] [edit]) > >+ * error names enumerated in jscntxt.c. It's not a compiletime check, > > I'm skeptical of compiletime being one word. Perhaps hyphenate? I merely rewrapped after indenting, vim did the work. This is mccabe's comment, IIRC. Fixed. > I wanted to use existing style of the JS engine to point out some nits, but > apparently there is little consistency in js/src/ for choosing between prefix > and postfix increment or decrement when it doesn't matter. (I prefer prefix.) In C code, for expression-statements or expressions whose value is discarded, it doesn't matter. for loops use i++ in the third part of the head, generally; we are moving toward ++i; for expression statements, just to match Mozilla C++ code style. Was there any other kind of nit you saw? /be
Comment 10•18 years ago
|
||
Checking in regress-346773.js; /cvsroot/mozilla/js/tests/js1_7/geniter/regress-346773.js,v <-- regress-346773.js initial revision: 1.1
Flags: in-testsuite+
Assignee | ||
Comment 11•18 years ago
|
||
Comment on attachment 231544 [details] [diff] [review] how about this? Yes, please.
Attachment #231544 -
Flags: review?(mrbkap) → review+
Comment 12•18 years ago
|
||
test case returns error: anonymous generator function returns a value Is that a bug? crash: verified fixed 1.8, 1.9 windows/mac(ppc|tel)/linux
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1 → verified1.8.1
Comment 13•18 years ago
|
||
(In reply to comment #12) > test case returns error: anonymous generator function returns a value > Is that a bug? In the testcase? Yes. You cannot return e; in a function containing yield expressions. You can fall off the end or return; (equivalently), which will throw StopIteration. /be
Assignee | ||
Comment 14•18 years ago
|
||
(In reply to comment #12) > test case returns error: anonymous generator function returns a value > Is that a bug? To be clear, the crash was caused by attempting to report *this* error. The mismatched braces didn't actually play into the testcase.
Comment 15•18 years ago
|
||
Checking in regress-346773.js; /cvsroot/mozilla/js/tests/js1_7/geniter/regress-346773.js,v <-- regress-346773.js new revision: 1.2; previous revision: 1.1 confirmed this version of the test still crashes in 07/31 builds. the return gen() was required for the crash.
Flags: blocking1.8.1?
You need to log in
before you can comment on or make changes to this bug.
Description
•