Skip to content

Commit

Permalink
Revert previous EntryPointNotFoundException; modify test
Browse files Browse the repository at this point in the history
  • Loading branch information
steveharter committed Apr 3, 2022
1 parent 59ef825 commit b667080
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,6 @@ Signature LazyCreateSignature()
{
return RuntimeMethodHandle.InvokeMethod(obj, (void**)arguments, Signature, isConstructor: false);
}
catch (EntryPointNotFoundException)
{
// Don't wrap since the exception did not originate from within the method.
throw;
}
catch (Exception e)
{
throw new TargetInvocationException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ internal unsafe object InvokeNonEmitUnsafe(object? obj, IntPtr* args, Span<objec
{
return RuntimeMethodHandle.InvokeMethod(obj, (void**)args, Signature, isConstructor: obj is null)!;
}
catch (EntryPointNotFoundException)
{
// Don't wrap since the exception did not originate from within the method.
throw;
}
catch (Exception ex)
{
throw new TargetInvocationException(ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,6 @@ public override MethodImplAttributes GetMethodImplementationFlags()
{
return RuntimeMethodHandle.InvokeMethod(obj, (void**)arguments, Signature, isConstructor: false);
}
catch (EntryPointNotFoundException)
{
// Don't wrap since the exception did not originate from within the method.
throw;
}
catch (Exception e)
{
throw new TargetInvocationException(e);
Expand Down
4 changes: 2 additions & 2 deletions src/tests/reflection/DefaultInterfaceMethods/Emit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static int Main()
{
ifooType.GetMethod("DefaultMethod").Invoke(o, null);
}
catch (EntryPointNotFoundException)
catch (TargetInvocationException ie) when (ie.InnerException is EntryPointNotFoundException)
{
result |= 0x10;
}
Expand All @@ -126,7 +126,7 @@ static int Main()
{
ifooType.GetMethod("InterfaceMethod").Invoke(o, null);
}
catch (EntryPointNotFoundException)
catch (TargetInvocationException ie) when (ie.InnerException is EntryPointNotFoundException)
{
result |= 0x20;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Reflection;

class Program
{
Expand Down Expand Up @@ -42,7 +43,7 @@ static int Main()
typeof(IFoo).GetMethod("DefaultMethod").Invoke(new Reabstractor(), new object[] { 1 });
return 501;
}
catch (EntryPointNotFoundException)
catch (TargetInvocationException ie) when (ie.InnerException is EntryPointNotFoundException)
{
}

Expand Down

0 comments on commit b667080

Please sign in to comment.