[INFER] Watch out for Invoke called on dummy frames when deciding to use a new type for the result, bug 653262.

This commit is contained in:
Brian Hackett 2011-05-01 17:45:53 -07:00
parent 052373f8bb
commit f6366f7596
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,6 @@
var HAVE_TM = 'tracemonkey' in this;
var HOTLOOP = HAVE_TM ? tracemonkey : 8;
with(evalcx(''))(function eval() {}, this.__defineGetter__("x", Function));
var i = 0;
var o;
new(x);

View File

@ -656,7 +656,7 @@ Invoke(JSContext *cx, const CallArgs &argsRef, ConstructOption option)
JSScript *script = fun->script();
if (JS_UNLIKELY(script->isEmpty())) {
if (option == INVOKE_CONSTRUCTOR) {
bool newType = cx->typeInferenceEnabled() &&
bool newType = cx->typeInferenceEnabled() && cx->fp()->isScriptFrame() &&
UseNewType(cx, cx->fp()->script(), cx->regs().pc);
JSObject *obj = js_CreateThisForFunction(cx, &callee, newType);
if (!obj)