Closed
Bug 581769
Opened 14 years ago
Closed 14 years ago
"Assertion failure: JSID_IS_INT(id) || JSID_IS_ATOM(id)," with E4X
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
People
(Reporter: gkw, Assigned: luke)
References
Details
(Keywords: assertion, regression, testcase, Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
3.18 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
__defineGetter__(<x/>,function(){}) for(w in this){} asserts js debug shell on TM tip without -j at Assertion failure: JSID_IS_INT(id) || JSID_IS_ATOM(id), at ../jsiter.cpp:206
Reporter | ||
Comment 1•14 years ago
|
||
autoBisect shows this is probably related to the following changeset: The first bad revision is: changeset: 47546:9c869e64ee26 user: Luke Wagner date: Wed Jul 14 23:19:36 2010 -0700 summary: Bug 549143 - fatvals
Blocks: fatvals
Summary: "Assertion failure: JSID_IS_INT(id) || JSID_IS_ATOM(id)," → "Assertion failure: JSID_IS_INT(id) || JSID_IS_ATOM(id)," with E4X
Assignee | ||
Comment 2•14 years ago
|
||
The issue here is that fatvals is producing a JSID_IS_OBJECT id in __defineGetter__ whereas pre-fatvals is producing a JSID_IS_STRING (specifically, ""). The reason is that, when determining whether to stick an object in an id directly or use the generic js_ValueToStringId (which will turn <x/> to ""), fatvals uses the predicate (obj->isXML()) whereas pre-fatvals uses the predicate (clasp == &js_QNameClass || clasp == &js_AttributeNameClass || clasp == &js_AnyNameClass). Thus <x/> matches the the first but not the second. Note that js_InternNonIntElementId uses obj->isXML() to make the same determination. So my question: is this on purpose? That is, that JS_ValueToId uses a different predicate than js_InternNonIntElementId (and, hence, JSOP_GETELEM, JSOP_IN, JSOP_INCPROP, JSOP_SETELEM, JSOP_ENUMELEM, ...). If so, I'm happy to fix. Also, I'm not sure how one creates a QName, AttributeName, or AnyName, but it seems like if the testcase in comment 0 replace <x/> with one of those three, this would trigger the same assertion in Enumerate pre-fatval. Regardless, I think the assertion in Enumerate is overzealous.
Comment 3•14 years ago
|
||
js> <a b="2"/>.(t.__defineGetter__(@b, function(){})) Look and weep.
Assignee | ||
Comment 4•14 years ago
|
||
So, two fixes: - put ValueToId back the way it was, - take out the assert at the top of Enumerate, since objects can flow in too and Enumerate isn't actually assuming that the id is only one of those two.
Updated•14 years ago
|
Attachment #460342 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 5•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/7ff4f93bddaa
Assignee | ||
Updated•14 years ago
|
Whiteboard: fixed-in-tracemonkey
Comment 6•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/7ff4f93bddaa
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
blocking2.0: ? → betaN+
You need to log in
before you can comment on or make changes to this bug.
Description
•