Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
NewArrayBoundsInstruction.cs
Go to the documentation of this file.
2
4{
5 private readonly Type _elementType;
6
7 private readonly int _rank;
8
9 public override int ConsumedStack => _rank;
10
11 public override int ProducedStack => 1;
12
13 public override string InstructionName => "NewArrayBounds";
14
16 {
18 _rank = rank;
19 }
20
21 public override int Run(InterpretedFrame frame)
22 {
23 int[] array = new int[_rank];
24 for (int num = _rank - 1; num >= 0; num--)
25 {
26 int num2 = ConvertHelper.ToInt32NoNull(frame.Pop());
27 if (num2 < 0)
28 {
29 throw new OverflowException();
30 }
31 array[num] = num2;
32 }
34 frame.Push(value);
35 return 1;
36 }
37}
static unsafe Array CreateInstance(Type elementType, int length)
Definition Array.cs:473