Skip to content

Commit

Permalink
[MERGE #5300 @rajatd] Memop fix related to scanning for missing values
Browse files Browse the repository at this point in the history
Merge pull request #5300 from rajatd:prepareSeg

If the entire range of a memop operation fits in the head segment, properly check if there were any missing items in the head outside of that range, before setting HasNoMissingValues to true on the dst array.

This is needed only after #5110.
  • Loading branch information
dilijev committed Jun 22, 2018
2 parents 9e876e0 + e6b59af commit fbda525
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Runtime/Library/JavascriptArray.inl
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ SECOND_PASS:
else if (!HasNoMissingValues())
{
// Have we overwritten all the missing values?
if (!ScanForMissingValues<T>(0, startOffset))
if (!ScanForMissingValues<T>(0, startOffset) && !ScanForMissingValues<T>(startOffset + length, current->length))
{
SetHasNoMissingValues();
}
Expand Down
26 changes: 26 additions & 0 deletions test/Array/memop_missingValues.js
Original file line number Diff line number Diff line change
@@ -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");
6 changes: 6 additions & 0 deletions test/Array/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,12 @@
<compile-flags>-mic:1 -off:simplejit -mmoc:0</compile-flags>
</default>
</test>
<test>
<default>
<files>memop_missingValues.js</files>
<compile-flags>-mmoc:0</compile-flags>
</default>
</test>
<test>
<default>
<files>bug4587739.js</files>
Expand Down

0 comments on commit fbda525

Please sign in to comment.