File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -331,6 +331,12 @@ namespace Js
331331 // fixup the length with the change
332332 newLength += start;
333333 }
334+ if (newStart >= GetLength ())
335+ {
336+ // If we want to start copying past the length of the array, all index are no-op
337+ return true ;
338+ }
339+
334340 if (UInt32Math::Add (newStart, newLength) > GetLength ())
335341 {
336342 newLength = GetLength () - newStart;
Original file line number Diff line number Diff line change 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 foo ( ) {
7+ var a = new Int8Array ( 500 ) ;
8+ for ( var i = 500 ; i < 1000 ; ++ i ) {
9+ a [ i ] = 0 ;
10+ }
11+ }
12+
13+ foo ( ) ;
14+ foo ( ) ;
15+ WScript . Echo ( "PASSED" ) ;
Original file line number Diff line number Diff line change @@ -304,6 +304,12 @@ Below test fails with difference in space. Investigate the cause and re-enable t
304304 <compile-flags >-mic:1 -off:simplejit -off:JITLoopBody -mmoc:0</compile-flags >
305305 </default >
306306 </test >
307+ <test >
308+ <default >
309+ <files >memset_neg.js</files >
310+ <compile-flags >-mic:1 -off:simplejit -bgjit- -mmoc:0</compile-flags >
311+ </default >
312+ </test >
307313 <test >
308314 <default >
309315 <files >memcopy.js</files >
You can’t perform that action at this time.
0 commit comments