Skip to content

Commit

Permalink
FIX #6074 : cannot find exception handler on arm
Browse files Browse the repository at this point in the history
  • Loading branch information
chunseoklee committed Jul 1, 2016
1 parent 24a53c5 commit 3974095
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vm/exceptionhandling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4385,7 +4385,8 @@ VOID UnwindManagedExceptionPass2(PAL_SEHException& ex, CONTEXT* unwindStartConte
dispatcherContext.ControlPc = controlPc;
dispatcherContext.ImageBase = codeInfo.GetModuleBase();
#if defined(_TARGET_ARM_)
dispatcherContext.ControlPcIsUnwound = !(currentFrameContext->ContextFlags & CONTEXT_EXCEPTION_ACTIVE);
dispatcherContext.ControlPcIsUnwound = !(currentFrameContext->ContextFlags & CONTEXT_EXCEPTION_ACTIVE)
|| (currentFrameContext->ContextFlags & CONTEXT_UNWOUND_TO_CALL);

This comment has been minimized.

Copy link
@jkotas

jkotas Jul 1, 2016

Is there a reason to still check CONTEXT_EXCEPTION_ACTIVE?

Can this be simplified to just:

dispatcherContext.ControlPcIsUnwound = !!(currentFrameContext->ContextFlags & CONTEXT_UNWOUND_TO_CALL);

#endif
// Check whether we have a function table entry for the current controlPC.
// If yes, then call RtlVirtualUnwind to get the establisher frame pointer.
Expand Down Expand Up @@ -4533,7 +4534,8 @@ VOID DECLSPEC_NORETURN UnwindManagedExceptionPass1(PAL_SEHException& ex, CONTEXT
dispatcherContext.ControlPc = controlPc;
dispatcherContext.ImageBase = codeInfo.GetModuleBase();
#if defined(_TARGET_ARM_)
dispatcherContext.ControlPcIsUnwound = !(frameContext->ContextFlags & CONTEXT_EXCEPTION_ACTIVE);
dispatcherContext.ControlPcIsUnwound = !(frameContext->ContextFlags & CONTEXT_EXCEPTION_ACTIVE)
|| (frameContext->ContextFlags & CONTEXT_UNWOUND_TO_CALL);
#endif

// Check whether we have a function table entry for the current controlPC.
Expand Down

1 comment on commit 3974095

@chunseoklee
Copy link
Owner Author

Choose a reason for hiding this comment

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

Since throw jitted to call instrcution, your suggestion is OK. I will update patch.

Please sign in to comment.