diff --git a/lib/Runtime/Library/JavascriptArray.inl b/lib/Runtime/Library/JavascriptArray.inl index 4e31ca73889..0f906e23be1 100644 --- a/lib/Runtime/Library/JavascriptArray.inl +++ b/lib/Runtime/Library/JavascriptArray.inl @@ -892,7 +892,7 @@ SECOND_PASS: else if (!HasNoMissingValues()) { // Have we overwritten all the missing values? - if (!ScanForMissingValues(0, startOffset)) + if (!ScanForMissingValues(0, startOffset) && !ScanForMissingValues(startOffset + length, current->length)) { SetHasNoMissingValues(); } diff --git a/test/Array/memop_missingValues.js b/test/Array/memop_missingValues.js new file mode 100644 index 00000000000..5fea7317c10 --- /dev/null +++ b/test/Array/memop_missingValues.js @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------------------------------- +// Copyright (C) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. +//------------------------------------------------------------------------------------------------------- + +function test0() +{ + var GiantPrintArray = []; + var IntArr0 = new Array(1, 1); + var FloatArr0 = []; + FloatArr0[1] = 1; + FloatArr0[0] = 1; + FloatArr0[12] = 1; + var v5; + v5 = IntArr0.length; + for (var i = 0; i < v5; i++) { + FloatArr0[i] = IntArr0[i]; + } + GiantPrintArray.push(FloatArr0); + for (var v2 = 0; 0 < GiantPrintArray; 0) { + } +} +test0(); +test0(); +test0(); +print("passed"); \ No newline at end of file diff --git a/test/Array/rlexe.xml b/test/Array/rlexe.xml index 730463a34c3..f2940389bd2 100644 --- a/test/Array/rlexe.xml +++ b/test/Array/rlexe.xml @@ -714,6 +714,12 @@ -mic:1 -off:simplejit -mmoc:0 + + + memop_missingValues.js + -mmoc:0 + + bug4587739.js