This is an archive of the discontinued LLVM Phabricator instance.

[libunwind] Fix unwind_leaffunction.pass.cpp
AbandonedPublic

Authored by leonardchan on Dec 2 2021, 7:06 PM.

Details

Reviewers
danielkiss
vvereschaka
Group Reviewers
Restricted Project
Summary

It's possible for this test not to pass if the libc used does not provide unwind info for raise. We can replace it with __builtin_cast, which can lead to a SIGTRAP on x86_64 and a SIGILL on aarch64.

Using this alternative, a nop is needed before the __builtin_cast. This is because libunwind incorrectly decrements pc, which can cause pc to jump into the previous function and use the incorrect FDE.

Diff Detail

Event Timeline

leonardchan created this revision.Dec 2 2021, 7:06 PM
leonardchan requested review of this revision.Dec 2 2021, 7:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2021, 7:06 PM
leonardchan abandoned this revision.Dec 2 2021, 7:08 PM

I meant to commandeer https://reviews.llvm.org/D114818 rather than make a new patch.