Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm][AArch64] Fix BTI after returns_twice when call has no attributes
Previously we were looking for the returns twice attribute by manually getting the function attributes from the call. This meant that we only found attributes on the call itself, not what it was calling. So if you had: %call1 = call i32 @setjmp(ptr noundef null) We would not BTI protect that even though setjmp clearly needs it. Clang happens to produce: %call = call i32 @setjmp(ptr noundef null) #0 ; returns_twice So all valid calls were protected. This is not guaranteed, the frontend may choose not to put attributes on the call. It is undefined behaviour to call setjmp indirectly (https://pubs.opengroup.org/onlinepubs/9699919799/functions/setjmp.html) but as I misused the APIs here I think it's worth fixing up regardless. Added comments to the test file where the IR differs from what clang would output. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D144082
- Loading branch information
1 parent
2a2a6bf
commit 93164db
Showing
3 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters