diff --git a/js/src/builtin/Array.js b/js/src/builtin/Array.js index d020fbaa9fa..62179cbec94 100644 --- a/js/src/builtin/Array.js +++ b/js/src/builtin/Array.js @@ -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++) diff --git a/js/src/jit-test/tests/parallel/bug1033115-2.js b/js/src/jit-test/tests/parallel/bug1033115-2.js new file mode 100644 index 00000000000..fb02a2f5cbf --- /dev/null +++ b/js/src/jit-test/tests/parallel/bug1033115-2.js @@ -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(); diff --git a/js/src/jit-test/tests/parallel/bug1033115.js b/js/src/jit-test/tests/parallel/bug1033115.js new file mode 100644 index 00000000000..2a9f76f637a --- /dev/null +++ b/js/src/jit-test/tests/parallel/bug1033115.js @@ -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]; + }); +}