-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-VM-reflection-monoReflection issues specific to MonoVMReflection issues specific to MonoVMin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
One of the types from the test below is crashing the mono runtime in #71324 (most likely typeof(void))
Specific commit affected
39b0578
Relevant code:
[Theory]
[InlineData(typeof(void))]
[InlineData(typeof(Dictionary<,>))]
[InlineData(typeof(List<>))]
[InlineData(typeof(Nullable<>))]
[InlineData(typeof(int*))]
[InlineData(typeof(RefStruct))]
public static void CreateJsonTypeInfoWithInappropriateTypeThrows(Type type)
{
Assert.Throws<ArgumentException>(() => JsonTypeInfo.CreateJsonTypeInfo(type, new JsonSerializerOptions()));
}
// JsonTypeInfo.CreateJsonTypeInfo:
if (IsInvalidForSerialization(type)) // it seems it passed the check in the repro
{
ThrowHelper.ThrowArgumentException_CannotSerializeInvalidType(nameof(type), type, null, null);
}
s_createJsonTypeInfo ??= typeof(JsonTypeInfo).GetMethod(nameof(CreateJsonTypeInfo), new Type[] { typeof(JsonSerializerOptions) })!;
return (JsonTypeInfo)s_createJsonTypeInfo.MakeGenericMethod(type)
.Invoke(null, new object[] { options })!;Metadata
Metadata
Assignees
Labels
area-VM-reflection-monoReflection issues specific to MonoVMReflection issues specific to MonoVMin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged