Bug 554670: abort tracing on out-of-range args element read

This commit is contained in:
David Mandelin 2010-04-08 17:11:41 -07:00
parent 5ef05c8584
commit aa16e435ea
3 changed files with 19 additions and 4 deletions

View File

@ -11751,10 +11751,9 @@ TraceRecorder::record_JSOP_GETELEM()
uintN int_idx = JSVAL_TO_INT(idx);
jsval* vp = &afp->argv[int_idx];
if (idx_ins->isconstf()) {
if (int_idx >= 0 && int_idx < afp->argc)
v_ins = get(vp);
else
v_ins = INS_VOID();
if (int_idx < 0 || int_idx >= afp->argc)
RETURN_STOP_A("cannot trace arguments with out of range index");
v_ins = get(vp);
} else {
// If the index is not a constant expression, we generate LIR to load the value from
// the native stack area. The guard on js_ArgumentClass above ensures the up-to-date

View File

@ -0,0 +1,8 @@
x = true;
(function() {
for each(let c in [0, x]) {
(arguments)[4] *= c
}
})()
// don't assert

View File

@ -0,0 +1,8 @@
var c;
(function() {
for each(e in [0, 0]) {
(arguments)[1] *= c
}
})()
// don't assert