Fix 355982, r=self.

git-svn-id: svn://10.0.0.236/trunk@213330 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
brendan%mozilla.org
2006-10-09 04:11:40 +00:00
parent 99ebcd5206
commit d7c9dce9ff

View File

@@ -178,11 +178,13 @@ script_compile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
/* XXX thread safety was completely neglected in this function... */
oldscript = (JSScript *) JS_GetPrivate(cx, obj);
for (fp = cx->fp; fp; fp = fp->down) {
if (fp->script == oldscript) {
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
JSMSG_SELF_MODIFYING_SCRIPT);
return JS_FALSE;
if (oldscript) {
for (fp = cx->fp; fp; fp = fp->down) {
if (fp->script == oldscript) {
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
JSMSG_SELF_MODIFYING_SCRIPT);
return JS_FALSE;
}
}
}