Bug 477143 - jsstack.js static analysis error in js_GetPropertyHelper. r=mrbkap.

This commit is contained in:
Jason Orendorff
2009-02-18 13:14:41 -06:00
parent 9546da1def
commit 0025e3725f
2 changed files with 13 additions and 6 deletions

View File

@@ -4010,10 +4010,15 @@ js_GetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, jsval *vp,
if (id == ATOM_TO_JSID(cx->runtime->atomState.iteratorAtom))
return JS_TRUE;
/* Kludge to allow (typeof foo == "undefined") tests. */
pc += js_CodeSpec[op].length;
if (Detecting(cx, pc))
/* Do not warn about tests like (obj[prop] == undefined). */
if (cx->resolveFlags == JSRESOLVE_INFER) {
js_LeaveTrace(cx);
pc += js_CodeSpec[op].length;
if (Detecting(cx, pc))
return JS_TRUE;
} else if (cx->resolveFlags & JSRESOLVE_DETECTING) {
return JS_TRUE;
}
flags = JSREPORT_WARNING | JSREPORT_STRICT;
}