Bug 355497: infinite recursion with Array.slice/getter for 0. Patch by Seno.Aiko@gmail.com, r=crowder

This commit is contained in:
crowder%fiverocks.com 2007-01-10 17:04:35 +00:00
Родитель 47016a3d82
Коммит 6137d7e995
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -1474,6 +1474,18 @@ JSBool
js_InternalGetOrSet(JSContext *cx, JSObject *obj, jsid id, jsval fval,
JSAccessMode mode, uintN argc, jsval *argv, jsval *rval)
{
int stackDummy;
/*
* js_InternalInvoke could result in another try to get or set the same id
* again, see bug 355497.
*/
if (!JS_CHECK_STACK_SIZE(cx, stackDummy)) {
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
JSMSG_OVER_RECURSED);
return JS_FALSE;
}
/*
* Check general (not object-ops/class-specific) access from the running
* script to obj.id only if id has a scripted getter or setter that we're