This is an archive of the discontinued LLVM Phabricator instance.

[WinEH] Make setjmp work correctly with EH
ClosedPublic

Authored by majnemer on Feb 29 2016, 8:21 AM.

Details

Summary

32-bit X86 EH on Windows utilizes a stack of registration nodes
allocated and deallocated on entry/exit. A registration node contains a
bunch of EH personality specific information like which try-state we are
currently in.

Because a setjmp target allows control flow from arbitrary program
points, there is no way to ensure that the try-state we are in is
correctly updated once we transfer control.

MSVC compatible compilers, like MSVC and ICC, utilize runtime helpers to
reinitialize the try-state when a longjmp occurs. This is implemented
by adding additional arguments to _setjmp3: the desired try-state and
a helper routine to update the try-state.

Diff Detail

Repository
rL LLVM

Event Timeline

majnemer updated this revision to Diff 49381.Feb 29 2016, 8:21 AM
majnemer retitled this revision from to [WinEH] Make setjmp work correctly with EH.
majnemer updated this object.
majnemer added a subscriber: llvm-commits.
majnemer updated this revision to Diff 49393.Feb 29 2016, 10:58 AM
  • Simplify SetJmp3CallSites
rnk accepted this revision.Feb 29 2016, 11:14 AM
rnk edited edge metadata.

lgtm

lib/Target/X86/X86WinEHState.cpp
520 ↗(On Diff #49381)

Anything wrong with the old spelling?

This revision is now accepted and ready to land.Feb 29 2016, 11:14 AM
This revision was automatically updated to reflect the committed changes.