mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 11:28:38 +00:00
Detect cycles even when we're inserting a degenerate list of length 1. bug 328249, r=brendan
This commit is contained in:
parent
7e97371876
commit
19da7e1561
@ -3592,6 +3592,12 @@ Replace(JSContext *cx, JSXML *xml, jsval id, jsval v);
|
||||
static JSBool
|
||||
CheckCycle(JSContext *cx, JSXML *xml, JSXML *kid)
|
||||
{
|
||||
if (kid->xml_class == JSXML_CLASS_LIST) {
|
||||
JS_ASSERT(kid->xml_kids.length <= 1);
|
||||
if (kid->xml_kids.length != 0)
|
||||
kid = XMLARRAY_MEMBER(&kid->xml_kids, 0, JSXML);
|
||||
}
|
||||
|
||||
do {
|
||||
if (xml == kid) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
|
||||
|
Loading…
Reference in New Issue
Block a user