Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Runtime/Library/JavascriptArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7563,7 +7563,7 @@ namespace Js
{
return res;
}
if (JavascriptArray::Is(args[0]))
if (JavascriptArray::Is(args[0]) && !JavascriptArray::FromVar(args[0])->IsCrossSiteObject())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is still present in this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's Akrosh's fix. Mine was in FillFromArgs.

Copy link
Contributor

@dilijev dilijev Jan 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I guess it will just merge down. Anyway you'll want to retarget this PR to release/1.4 and rebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I missed this targeted master. Will update

{
#if ENABLE_COPYONACCESS_ARRAY
JavascriptLibrary::CheckAndConvertCopyOnAccessNativeIntArray<Var>(args[0]);
Expand Down
1 change: 1 addition & 0 deletions test/Array/shift_unshift.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ e instanceOf TypeError = true
a.length = 1
ary.length = 18
arr.length = 6
Crosssite new length: 2
Overridden unshift
Overridden unshift
Overridden unshift
Expand Down
9 changes: 8 additions & 1 deletion test/Array/shift_unshift.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ function test1(arr)

WScript.Echo("arr.length = " + test1(new Array(10)));

// OS 9357224: Array.prototype.unshift does not marshal parameters correctly
function crossSiteUnshift() {
var sc0 = WScript.LoadScript('', 'samethread');
sc0.ary = [1];
return sc0.eval('Array.prototype.unshift.call(ary, null)');
}
WScript.Echo("Crosssite new length: " + crossSiteUnshift()); // 2

//
// To check bailouts for inlined unshift
//
Expand All @@ -164,4 +172,3 @@ function foo()
Array.prototype.unshift = function(){WScript.Echo ("Overridden unshift")};
foo();
WScript.Echo (a);