Skip to content

Commit

Permalink
Fixed Ourpalm#692
Browse files Browse the repository at this point in the history
  • Loading branch information
liiir1985 committed May 25, 2022
1 parent 5dd7d1d commit c71e49d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ILRuntime/Runtime/Intepreter/ILIntepreter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,13 @@ public object Run(ILMethod method, object instance, object[] p)
}
else
{
intVal = (int)(ip - ptr);
var eh = FindExceptionHandlerByBranchTarget(intVal, finallyEndAddress, ehs);
if (eh != null)
{
ip = ptr + eh.HandlerStart;
continue;
}
ip = ptr + finallyEndAddress;
finallyEndAddress = 0;
continue;
Expand Down Expand Up @@ -4648,8 +4655,8 @@ ExceptionHandler FindExceptionHandlerByBranchTarget(int addr, int branchTarget,
var e = ehs[i];
if (addr >= e.TryStart && addr <= e.TryEnd && (branchTarget < e.TryStart || branchTarget > e.TryEnd) && e.HandlerType == ExceptionHandlerType.Finally)
{
eh = e;
break;
if (eh == null || e.TryStart > eh.TryStart)
eh = e;
}
}
return eh;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2776,6 +2776,13 @@ public unsafe partial class ILIntepreter
}
else
{
intVal = (int)(ip - ptr);
var eh = FindExceptionHandlerByBranchTarget(intVal, finallyEndAddress, ehs);
if (eh != null)
{
ip = ptr + eh.HandlerStart;
continue;
}
ip = ptr + finallyEndAddress;
finallyEndAddress = 0;
continue;
Expand Down

0 comments on commit c71e49d

Please sign in to comment.