[BOLT] Fix ignored LP at fragment start
authorFabian Parzefall <parzefall@fb.com>
Wed, 17 Aug 2022 23:34:43 +0000 (16:34 -0700)
committerFabian Parzefall <parzefall@fb.com>
Wed, 17 Aug 2022 23:34:44 +0000 (16:34 -0700)
commitfd159c23163e4c08df8a6f0147f4431d4c7504af
tree0263ef6fe2a6097b59e21999f2989ded99f6ccd7
parent4ddc9c8e12926ac87eb42f12adcf28fa97358dd4
[BOLT] Fix ignored LP at fragment start

If the first block of a fragment is also a landing pad, the landing pad
is not used if an exception is thrown. This is because the landing pad
is at the same start address that the corresponding LSDA describes. In
that case, the offset in the call site records to refer to that landing
pad is zero, and a zero offset is interpreted by the personality
function as "no handler" and ignored.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D132053
bolt/lib/Core/BinaryEmitter.cpp
bolt/test/runtime/X86/lp-fragment-start.s [new file with mode: 0644]