Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ private class TrailingAngleBracketPolicy : JsonNamingPolicy
[Theory]
[InlineData(typeof(KeyNameNullPolicy), "Key")]
[InlineData(typeof(ValueNameNullPolicy), "Value")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task InvalidPropertyNameFail(Type policyType, string offendingProperty)
{
var options = new JsonSerializerOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public async Task PublicParameterlessCtor_MultiplePublicParameterizedCtors_WithA

#if !BUILDING_SOURCE_GENERATOR_TESTS // These are compile-time warnings from the source generator.
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task MultipleAttributes_NotSupported()
{
async Task RunTestAsync<T>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ public async Task CaseInsensitiveFails()
#if BUILDING_SOURCE_GENERATOR_TESTS
[ActiveIssue("Multi-dim arrays not supported.")]
#endif
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task ClassWithUnsupportedCollectionTypes()
{
Exception e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ public class ClassWithTwoExtensionProperties
#if BUILDING_SOURCE_GENERATOR_TESTS
[ActiveIssue("https://github.com/dotnet/runtime/issues/58945")]
#endif
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task InvalidExtensionPropertyFail()
{
// Baseline
Expand Down Expand Up @@ -799,7 +798,7 @@ public async Task DeserializeIntoJsonObjectProperty()
#if BUILDING_SOURCE_GENERATOR_TESTS
[ActiveIssue("https://github.com/dotnet/runtime/issues/58945")]
#endif
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]

public async Task DeserializeIntoSystemObjectProperty()
{
string json = @"{""MyDict"":{""Property1"":1}}";
Expand Down Expand Up @@ -1089,7 +1088,6 @@ public class ClassWithInvalidExtensionPropertyStringJsonNode
#if BUILDING_SOURCE_GENERATOR_TESTS
[ActiveIssue("https://github.com/dotnet/runtime/issues/58945")]
#endif
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task ExtensionProperty_InvalidDictionary()
{
var obj1 = new ClassWithInvalidExtensionPropertyStringString();
Expand Down Expand Up @@ -1149,7 +1147,6 @@ public class ClassWithMultipleDictionaries
#if BUILDING_SOURCE_GENERATOR_TESTS
[ActiveIssue("https://github.com/dotnet/runtime/issues/58945")]
#endif
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task DeserializeIntoImmutableDictionaryProperty()
{
// baseline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public async Task CustomNamePolicy()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task NullNamePolicy()
{
var options = new JsonSerializerOptions();
Expand Down Expand Up @@ -128,7 +127,6 @@ public async Task JsonPropertyNameAttribute()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task JsonNameAttributeDuplicateDesignTimeFail()
{
{
Expand All @@ -143,7 +141,6 @@ public async Task JsonNameAttributeDuplicateDesignTimeFail()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task JsonNameConflictOnCamelCasingFail()
{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ public class ClassWithMixedPropertyAccessors_PropertyAttributes
[InlineData(typeof(ClassWithPrivate_InitOnlyProperty_WithJsonIncludeProperty))]
[InlineData(typeof(ClassWithInternal_InitOnlyProperty_WithJsonIncludeProperty))]
[InlineData(typeof(ClassWithProtected_InitOnlyProperty_WithJsonIncludeProperty))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public virtual async Task NonPublicProperty_WithJsonInclude_Invalid(Type type)
{
InvalidOperationException ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await Serializer.DeserializeWrapper("{}", type));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ public async Task Ignore_PublicProperty_ConflictWithPublicDuePolicy()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicProperty_ConflictDueAttributes()
{
// Serialize
Expand All @@ -354,7 +353,6 @@ await Assert.ThrowsAsync<InvalidOperationException>(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicPropertyAndField_ConflictDueAttributes()
{
// Serialize
Expand All @@ -369,7 +367,6 @@ await Assert.ThrowsAsync<InvalidOperationException>(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicProperty_ConflictDueAttributes_SingleInheritance()
{
// Serialize
Expand All @@ -393,7 +390,6 @@ await Assert.ThrowsAsync<InvalidOperationException>(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicPropertyAndField_ConflictDueAttributes_SingleInheritance()
{
// Serialize
Expand All @@ -417,7 +413,6 @@ await Assert.ThrowsAsync<InvalidOperationException>(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicProperty_ConflictDueAttributes_DoubleInheritance()
{
// Serialize
Expand All @@ -442,7 +437,6 @@ await Assert.ThrowsAsync<InvalidOperationException>(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicPropertyAndField_ConflictDueAttributes_DoubleInheritance()
{
// Serialize
Expand All @@ -467,7 +461,6 @@ await Assert.ThrowsAsync<InvalidOperationException>(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicProperty_ConflictDuePolicy()
{
var options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
Expand All @@ -484,7 +477,6 @@ await Assert.ThrowsAsync<InvalidOperationException>(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicPropertyAndField_ConflictDuePolicy()
{
var options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
Expand All @@ -501,7 +493,6 @@ await Assert.ThrowsAsync<InvalidOperationException>(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicProperty_ConflictDuePolicy_SingleInheritance()
{
var options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
Expand All @@ -528,7 +519,6 @@ await Assert.ThrowsAsync<InvalidOperationException>(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicPropertyAndField_ConflictDuePolicy_SingleInheritance()
{
var options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
Expand All @@ -555,7 +545,6 @@ await Assert.ThrowsAsync<InvalidOperationException>(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicProperty_ConflictDuePolicy_DobuleInheritance()
{
var options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
Expand Down Expand Up @@ -583,7 +572,6 @@ await Assert.ThrowsAsync<InvalidOperationException>(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task Throw_PublicPropertyAndField_ConflictDuePolicy_DobuleInheritance()
{
var options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
Expand Down Expand Up @@ -1150,7 +1138,6 @@ public async Task JsonIgnoreAttribute()
// Needs support for more collections.
[ActiveIssue("https://github.com/dotnet/runtime/issues/53393")]
#endif
[ActiveIssue("https://github.com/dotnet/runtime/issues/71981")]
public async Task JsonIgnoreAttribute_UnsupportedCollection()
{
string json =
Expand Down Expand Up @@ -2426,7 +2413,6 @@ public class ClassWithThingsToIgnore_PerProperty
[Theory]
[InlineData(typeof(ClassWithBadIgnoreAttribute))]
[InlineData(typeof(StructWithBadIgnoreAttribute))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public virtual async Task JsonIgnoreCondition_WhenWritingNull_OnValueType_Fail(Type type)
{
InvalidOperationException ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await Serializer.DeserializeWrapper("{}", type));
Expand All @@ -2447,7 +2433,6 @@ public virtual async Task JsonIgnoreCondition_WhenWritingNull_OnValueType_Fail(T
[Theory]
[InlineData(typeof(ClassWithBadIgnoreAttribute))]
[InlineData(typeof(StructWithBadIgnoreAttribute))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public virtual async Task JsonIgnoreCondition_WhenWritingNull_OnValueType_Fail_EmptyJson(Type type)
{
InvalidOperationException ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await Serializer.DeserializeWrapper("", type));
Expand Down Expand Up @@ -2760,7 +2745,6 @@ public async Task JsonIgnoreCondition_Polymorphic()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task SerializationMetadataNotComputedWhenMemberIgnored()
{
string janePayload = @"{""Name"":""Jane Doe""}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ public PropertyVisibilityTests_Default()
[InlineData(typeof(ClassWithPrivate_InitOnlyProperty_WithJsonIncludeProperty))]
[InlineData(typeof(ClassWithInternal_InitOnlyProperty_WithJsonIncludeProperty))]
[InlineData(typeof(ClassWithProtected_InitOnlyProperty_WithJsonIncludeProperty))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public override async Task NonPublicProperty_WithJsonInclude_Invalid(Type type)
{
// Exception messages direct users to use JsonSourceGenerationMode.Metadata to see a more detailed error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public void DeserializeInvalidType(Type type)

[Theory]
[MemberData(nameof(TypesWithInvalidMembers_WithMembers))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task TypeWithInvalidMember(Type classType, Type invalidMemberType, string invalidMemberName)
{
static void ValidateException(InvalidOperationException ex, Type classType, Type invalidMemberType, string invalidMemberName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public async Task JsonNullNameAttribute()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/71838", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public async Task JsonNameConflictOnCaseInsensitiveFail()
{
string json = @"{""myInt"":1,""MyInt"":2}";
Expand Down
4 changes: 2 additions & 2 deletions src/mono/mono/mini/interp/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2119,13 +2119,13 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject

context->stack_pointer = (guchar*)sp;

check_pending_unwind (context);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you also need to change interp_entry ?

Copy link
Member

@BrzVlad BrzVlad Jul 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check_pending_unwind seems dubious to me. It throws a C++ exception, but this is only caught in llvmonly code. This code probably needs some refactoring.

I think the intended behavior for check_pending_unwind should be

if (mono_aot_mode == MONO_AOT_MODE_LLVMONLY_INTERP && context->has_resume_state)
    mono_llvm_cpp_throw_exception ();

Additionally, when exiting the interpreter (returning from interp_entry, interp_entry_from_trampoline, interp_runtime_invoke) we probably should assert !context->has_resume_state, because if we have resume state here it means we are in non-llvmonly mode where we resume directly to the ip of the handling code. When returning to EH (interp_run_finally ...) we can probably assert that we have context->handler_frame set if we have resume state, since otherwise we should have resumed already)

Maybe we should have 2 check_pending_unwind methods, one for returning to compiled/native and the other for returning to EH since their behavior is quite different.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The !context->handler_frame check can only be true in mixed mode.


if (context->has_resume_state) {
/*
* This can happen on wasm where native frames cannot be skipped during EH.
* EH processing will continue when control returns to the interpreter.
*/
if (mono_aot_mode == MONO_AOT_MODE_LLVMONLY_INTERP)
mono_llvm_cpp_throw_exception ();
return NULL;
}
// The return value is at the bottom of the stack
Expand Down