summaryrefslogtreecommitdiff
path: root/include/sanitizer
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-04-10 13:59:32 +0000
committerKostya Serebryany <kcc@google.com>2013-04-10 13:59:32 +0000
commitdc0d17952a060731e47d056f8487d0744037f52e (patch)
tree76634191bc5b0f134fce0efd1ed26c83a3a9bd16 /include/sanitizer
parentf3f2f5ced1fa60dcec46f423297d5e651db8437f (diff)
[asan] implement callbacks for unaligned loads/stores
Reviewers: samsonov Reviewed By: samsonov CC: samsonov, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D652 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@179175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/sanitizer')
-rw-r--r--include/sanitizer/common_interface_defs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/sanitizer/common_interface_defs.h b/include/sanitizer/common_interface_defs.h
index 74e3b22cc..31d0dea54 100644
--- a/include/sanitizer/common_interface_defs.h
+++ b/include/sanitizer/common_interface_defs.h
@@ -41,6 +41,16 @@ extern "C" {
// the error message. This function can be overridden by the client.
void __sanitizer_report_error_summary(const char *error_summary);
+ // Some of the sanitizers (e.g. asan/tsan) may miss bugs that happen
+ // in unaligned loads/stores. In order to find such bugs reliably one needs
+ // to replace plain unaligned loads/stores with these calls.
+ uint16_t __sanitizer_unaligned_load16(const void *p);
+ uint32_t __sanitizer_unaligned_load32(const void *p);
+ uint64_t __sanitizer_unaligned_load64(const void *p);
+ void __sanitizer_unaligned_store16(void *p, uint16_t x);
+ void __sanitizer_unaligned_store32(void *p, uint32_t x);
+ void __sanitizer_unaligned_store64(void *p, uint64_t x);
+
#ifdef __cplusplus
} // extern "C"
#endif