[INFER] Avoid unnecessary cast, bug 642319.

This commit is contained in:
Brian Hackett 2011-03-17 11:57:32 -07:00
parent b875c13ba0
commit 33969c35e9
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,10 @@
test();
function test() {
function f() {
function test( ) { summary( summary, test, false ); }
}
f.__proto__ = this;
}
gc();
test();

View File

@ -3228,7 +3228,6 @@ AnalyzeBytecode(JSContext *cx, AnalyzeState &state, JSScript *script, uint32 off
case JSOP_DEFLOCALFUN_FC: {
unsigned off = (op == JSOP_DEFLOCALFUN || op == JSOP_DEFLOCALFUN_FC) ? SLOTNO_LEN : 0;
JSObject *obj = GetScriptObject(cx, script, pc, off);
TypeFunction *function = obj->getType()->asFunction();
TypeSet *res = NULL;
if (op == JSOP_LAMBDA || op == JSOP_LAMBDA_FC)
@ -3238,7 +3237,7 @@ AnalyzeBytecode(JSContext *cx, AnalyzeState &state, JSScript *script, uint32 off
if (res) {
if (script->compileAndGo)
res->addType(cx, (jstype) function);
res->addType(cx, (jstype) obj->getType());
else
res->addType(cx, TYPE_UNKNOWN);
} else {