Skip to content

Commit e6b59af

Browse files
committed
Memop fix related to scanning for missing values
1 parent f8e9e55 commit e6b59af

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

lib/Runtime/Library/JavascriptArray.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ SECOND_PASS:
892892
else if (!HasNoMissingValues())
893893
{
894894
// Have we overwritten all the missing values?
895-
if (!ScanForMissingValues<T>(0, startOffset))
895+
if (!ScanForMissingValues<T>(0, startOffset) && !ScanForMissingValues<T>(startOffset + length, current->length))
896896
{
897897
SetHasNoMissingValues();
898898
}

test/Array/memop_missingValues.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//-------------------------------------------------------------------------------------------------------
2+
// Copyright (C) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
4+
//-------------------------------------------------------------------------------------------------------
5+
6+
function test0()
7+
{
8+
var GiantPrintArray = [];
9+
var IntArr0 = new Array(1, 1);
10+
var FloatArr0 = [];
11+
FloatArr0[1] = 1;
12+
FloatArr0[0] = 1;
13+
FloatArr0[12] = 1;
14+
var v5;
15+
v5 = IntArr0.length;
16+
for (var i = 0; i < v5; i++) {
17+
FloatArr0[i] = IntArr0[i];
18+
}
19+
GiantPrintArray.push(FloatArr0);
20+
for (var v2 = 0; 0 < GiantPrintArray; 0) {
21+
}
22+
}
23+
test0();
24+
test0();
25+
test0();
26+
print("passed");

test/Array/rlexe.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,12 @@
714714
<compile-flags>-mic:1 -off:simplejit -mmoc:0</compile-flags>
715715
</default>
716716
</test>
717+
<test>
718+
<default>
719+
<files>memop_missingValues.js</files>
720+
<compile-flags>-mmoc:0</compile-flags>
721+
</default>
722+
</test>
717723
<test>
718724
<default>
719725
<files>bug4587739.js</files>

0 commit comments

Comments
 (0)