[llvm-dev] Exception handling support for a target

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 16 11:41:59 PST 2018


On 16 January 2018 at 13:41, 陳韋任 <chenwj.cs97g at g2.nctu.edu.tw> wrote:
> bar:
>
>     .cfi_def_cfa_offset 16
>     epilogue
>
>     _Unwind_Resume
>
>
>
> The lookup phase of exception handling is fine. However, something goes
> wrong in cleanup phase. The reason is the unwinder evaluates CFI directives
> until _Unwind_Resume, and `.cfi_def_cfa_offset 16` is the culprit. I think
> this is what you were saying "have an epilogue in the middle of a function",
> right?

I think so, though the assembly isn't really complete enough to tell.
In this case if the .cfi_def_cfa_offset is describing the epilogue it
would mean that all code in what you've labelled _Unwind_Resume
(assuming that's actually a cleanup landing pad or something) will use
the wrong SP to load the saved registers from. The unwinder will think
it's executing directly after the epilogue since it's later on in the
function.

Cheers.

Tim.


More information about the llvm-dev mailing list