Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DFSan] Add
zeroext
attribute for callbacks with 8bit shadow variab…
…le arguments Add `zeroext` attribute for below callbacks' first parameter (8bit shadow variable arguments) to conform to many platforms' ABI calling convention and some compiler behavior. - __dfsan_load_callback - __dfsan_store_callback - __dfsan_cmp_callback - __dfsan_conditional_callback - __dfsan_conditional_callback_origin - __dfsan_reaches_function_callback - __dfsan_reaches_function_callback_origin The type of these callbacks' first parameter is u8 (see the definition of `dfsan_label`). First, many platforms' ABI requires unsigned integer data types (except unsigned int) are zero-extended when stored in general-purpose register. Second, the problem is that compiler optimization may assume the arguments are zero-extended and, if not, misbehave, e.g. it uses an `i8` argument to index into a jump table. If the argument has non-zero high bits, the output executable may crash at run-time. So we need to add the `zeroext` attribute when declaring and calling them. Reviewed By: browneee, MaskRay Differential Revision: https://reviews.llvm.org/D140689
- Loading branch information
1 parent
2468b3f
commit 14ce567
Showing
6 changed files
with
83 additions
and
37 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
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