Bug 484750 - Assertion failure: newlen == 0 || obj->dslots[newlen - 1] != JSVAL_HOLE, at ../jsarray.cpp. Modify an assertion to properly handle intentional fenceposting behavior where we copy 0 elements to the end of an array -- can't assert that the end of the array isn't a hole in this case because we're intentionally not changing the array from what it was before -- demonstrated by [,].splice(1). r=me as obvious from debugging the testcase

This commit is contained in:
Jeff Walden 2009-03-23 00:26:52 -07:00
parent 4efdc2378b
commit 6f7d355335

View File

@ -1600,7 +1600,7 @@ InitArrayElements(JSContext *cx, JSObject *obj, jsuint start, jsuint count, jsva
JS_ASSERT(count < size_t(-1) / sizeof(jsval));
memcpy(obj->dslots + start, vector, sizeof(jsval) * count);
JS_ASSERT(newlen == 0 || obj->dslots[newlen - 1] != JSVAL_HOLE);
JS_ASSERT_IF(count != 0, obj->dslots[newlen - 1] != JSVAL_HOLE);
return JS_TRUE;
}