Skip to content

Commit

Permalink
use regular arrays for arguments (dotnet#5011)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonerdo committed May 12, 2020
1 parent 5ef8150 commit dc74830
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2671,13 +2671,14 @@ private unsafe void InterpretNewObj(int token)

if (owningType.IsArray)
{
LowLevelList<int> lArguments = new LowLevelList<int>(arguments.Length);
int[] lArguments = new int[arguments.Length];
for (int i = arguments.Length - 1; i >= 0; i--)
{
lArguments.Add(arguments[i].AsInt32());
lArguments[i] = arguments[i].AsInt32();
}

Array array = RuntimeAugments.NewObjArray(owningType.GetRuntimeTypeHandle(), lArguments.ToArray());
Array.Reverse(lArguments);
Array array = RuntimeAugments.NewObjArray(owningType.GetRuntimeTypeHandle(), lArguments);
_stack.Push(StackItem.FromObjectRef(array));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<Compile Include="..\..\Common\src\TypeSystem\IL\ILReader.cs" />
<Compile Include="..\..\Common\src\TypeSystem\IL\StackValueKind.cs" />
<Compile Include="..\..\Common\src\System\Collections\Generic\LowLevelStack.cs" />
<Compile Include="..\..\Common\src\System\Collections\Generic\LowLevelList.cs" />
<Compile Include="Internal\Runtime\CompilerHelpers\LibraryInitializer.cs" />
<Compile Include="Internal\Runtime\Interpreter\StackItem.cs" />
</ItemGroup>
Expand Down

0 comments on commit dc74830

Please sign in to comment.