Bug 541255 - "Assertion failure: obj->isDenseArray(), at ../jsarray.cpp". r=brendan.

This commit is contained in:
Jason Orendorff 2010-03-29 11:24:42 -05:00
parent 75ca35caf0
commit e5a722c5a8
8 changed files with 79 additions and 2 deletions

View File

@ -1588,7 +1588,7 @@ js_GetUpvar(JSContext *cx, uintN level, uintN cookie)
uintN slot = UPVAR_FRAME_SLOT(cookie); uintN slot = UPVAR_FRAME_SLOT(cookie);
jsval *vp; jsval *vp;
if (!fp->fun) { if (!fp->fun || (fp->flags & JSFRAME_EVAL)) {
vp = fp->slots + fp->script->nfixed; vp = fp->slots + fp->script->nfixed;
} else if (slot < fp->fun->nargs) { } else if (slot < fp->fun->nargs) {
vp = fp->argv; vp = fp->argv;

View File

@ -12213,7 +12213,7 @@ TraceRecorder::upvar(JSScript* script, JSUpvarArray* uva, uintN index, jsval& v)
JSStackFrame* fp = cx->display[level]; JSStackFrame* fp = cx->display[level];
const CallInfo* ci; const CallInfo* ci;
int32 slot; int32 slot;
if (!fp->fun) { if (!fp->fun || (fp->flags & JSFRAME_EVAL)) {
ci = &GetUpvarStackOnTrace_ci; ci = &GetUpvarStackOnTrace_ci;
slot = cookieSlot; slot = cookieSlot;
} else if (cookieSlot < fp->fun->nargs) { } else if (cookieSlot < fp->fun->nargs) {

View File

@ -1,4 +1,9 @@
url-prefix ../../jsreftest.html?test=js1_8_5/regress/ url-prefix ../../jsreftest.html?test=js1_8_5/regress/
fails script regress-533876.js fails script regress-533876.js
script regress-541255-0.js
script regress-541255-1.js
script regress-541255-2.js
script regress-541255-3.js
script regress-541255-4.js
script regress-541455.js script regress-541455.js
script regress-546615.js script regress-546615.js

View File

@ -0,0 +1,14 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/
* Contributor: Gary Kwong
*/
(function(e) {
eval("\
[(function() {\
x.k = function(){}\
})() \
for (x in [0])]\
")
})();
print(" PASSED!");

View File

@ -0,0 +1,23 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/
* Contributor: Gary Kwong
*/
function f(e) {
eval("\
[((function g(o, bbbbbb) {\
if (aaaaaa = bbbbbb) {\
return window.r = []\
}\
g(aaaaaa, bbbbbb + 1);\
#3={}\
})([], 0)) \
for (window in this) \
for each(x in [0, 0])\
]\
")
}
t = 1;
f();
print(" PASSED!");

View File

@ -0,0 +1,11 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/
* Contributors: Gary Kwong and Jason Orendorff
*/
function f(e) {
eval("[function () { w.r = 0 }() for (w in [0])]")
}
f(0);
print(" PASSED!");

View File

@ -0,0 +1,13 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/
* Contributors: Gary Kwong and Jason Orendorff
*/
function f(y) {
eval("let (z=2, w=y) { (function () { w.p = 7; })(); }");
}
var x = {};
f(x);
assertEq(x.p, 7);
print(" PASSED!");

View File

@ -0,0 +1,11 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/
* Contributors: Gary Kwong and Jason Orendorff
*/
function f(e) {
eval("[function () { w.r = 0 }() for (w in [0,1,2,3,4,5,6,7,8,9])]")
}
f(0);
print(" PASSED!");