Commit 96c8b12
committed
[MERGE chakra-core#2201 @tcare] Array.prototype.unshift does not marshal parameters correctly
Merge pull request chakra-core#2201 from tcare:unshift
Fixes OS 9357224.
Array.prototype.unshift prepends array values to 'this' array by calling JavascriptArray::FillFromArgs. FillFromArgs makes the assumption that values are already marshalled to the same context as 'this'. It is possible to have a situation in Array.prototype.unshift where the source array is in another context than the parameters passed in, triggering the assert. Other users of FillFromArgs (e.g. new Array()) don't seem to be able to hit this situation. Fix is to marshal values as we iterate in FillFromArgs.3 files changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7563 | 7563 | | |
7564 | 7564 | | |
7565 | 7565 | | |
7566 | | - | |
| 7566 | + | |
7567 | 7567 | | |
7568 | 7568 | | |
7569 | 7569 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
143 | 151 | | |
144 | 152 | | |
145 | 153 | | |
| |||
164 | 172 | | |
165 | 173 | | |
166 | 174 | | |
167 | | - | |
| |||
0 commit comments