/// <inheritdoc /> public void StoreElementI(int index, NativeIntegerValue value, ICliMarshaller marshaller) { AssertIndexValidity(index); var ctsValue = marshaller.ToCtsValue(value, CorLibTypeFactory.IntPtr); if (Contents.Is32Bit) { Contents.WriteInteger32(index * sizeof(uint), (Integer32Value)ctsValue); } else { Contents.WriteInteger64(index * sizeof(uint), (Integer64Value)ctsValue); } }
private static (IntegerValue, int?) PopArguments(ExecutionContext context) { var value2 = context.ProgramState.Stack.Pop(); var value1 = context.ProgramState.Stack.Pop(); int?shiftCount = null; if (value2.IsKnown) { shiftCount = value2 switch { I4Value int32 => int32.I32, NativeIntegerValue nativeInt => (int?)nativeInt.ToKnownI64(), _ => null }; } return(value1 as IntegerValue, shiftCount); } }
/// <inheritdoc /> public void StoreElementI(int index, NativeIntegerValue value, ICliMarshaller marshaller) => _values[index] = marshaller.ToCtsValue(value, CorLibTypeFactory.IntPtr);