|
@ -52,16 +52,19 @@ namespace IPA.Config.Stores |
|
|
il.MarkLabel(passedNull); |
|
|
il.MarkLabel(passedNull); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (member.IsNullable) |
|
|
|
|
|
|
|
|
if (member is { IsNullable: true, HasConverter: false }) |
|
|
il.Emit(OpCodes.Call, member.Nullable_Value.GetGetMethod()); |
|
|
il.Emit(OpCodes.Call, member.Nullable_Value.GetGetMethod()); |
|
|
|
|
|
|
|
|
var memberConversionType = member.ConversionType; |
|
|
var memberConversionType = member.ConversionType; |
|
|
var targetType = GetExpectedValueTypeForType(memberConversionType); |
|
|
var targetType = GetExpectedValueTypeForType(memberConversionType); |
|
|
if (member.HasConverter) |
|
|
if (member.HasConverter) |
|
|
{ |
|
|
{ |
|
|
using var stlocal = GetLocal.Allocate(memberConversionType); |
|
|
|
|
|
|
|
|
using var stlocal = GetLocal.Allocate(member.IsNullable ? member.Type : memberConversionType); |
|
|
using var valLocal = GetLocal.Allocate(typeof(Value)); |
|
|
using var valLocal = GetLocal.Allocate(typeof(Value)); |
|
|
|
|
|
|
|
|
|
|
|
if (member.IsNullable) |
|
|
|
|
|
il.Emit(OpCodes.Ldloc_S, valueTypeLocal.Local); |
|
|
|
|
|
|
|
|
il.Emit(OpCodes.Stloc, stlocal); |
|
|
il.Emit(OpCodes.Stloc, stlocal); |
|
|
il.BeginExceptionBlock(); |
|
|
il.BeginExceptionBlock(); |
|
|
il.Emit(OpCodes.Ldsfld, member.ConverterField); |
|
|
il.Emit(OpCodes.Ldsfld, member.ConverterField); |
|
|