Bug 1033115 - pass intermediate array as root for PJS gc for Array.prototype.reducePar. r=shu

This commit is contained in:
Lars T Hansen 2014-07-02 17:08:56 +02:00
parent 749d42ac21
commit b8cf55d45c
3 changed files with 35 additions and 1 deletions

View File

@ -817,7 +817,7 @@ function ArrayReducePar(func, mode) {
var numSlices = slicesInfo.count;
var subreductions = NewDenseArray(numSlices);
ForkJoin(reduceThread, 0, numSlices, ForkJoinMode(mode), null);
ForkJoin(reduceThread, 0, numSlices, ForkJoinMode(mode), subreductions);
var accumulator = subreductions[0];
for (var i = 1; i < numSlices; i++)

View File

@ -0,0 +1,21 @@
// Failed to pass the subreductions as an assignment root to Array.prototype.reducePar,
// fuzzing test case discovered separately.
if (!getBuildConfiguration().parallelJS)
quit(0);
x = [];
y = x.mapPar(function() {});
Object.defineProperty(y, 3, {
get: (function( ... $8) {
try {
Int8Array(y);
x.reducePar(function() function q() 1);
} catch (e) {}
})
});
var x = [1,2,3];
function rsh() {
return y.toSource() >> 2.0;
}
rsh();

View File

@ -0,0 +1,13 @@
// Failed to pass the subreductions as an assignment root to Array.prototype.reducePar,
// fuzzing test case.
if (!getBuildConfiguration().parallelJS)
quit(0);
x = []
x[8] = ((function() {})());
for each(let a in [0, 0]) {
x.reducePar(function() {
return [0];
});
}