[llvm-branch-commits] [lld] [libcxx] [llvm] [compiler-rt] [clang-tools-extra] [clang] [test][hwasan] Implement sanitizer_specific for HWASAN (PR #75280)

Thurston Dang via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 13 10:58:44 PST 2023


================
@@ -42,7 +42,18 @@ static void make_mem_good(void *p, size_t s) {
   __hwasan_tag_memory(p, __hwasan_get_tag_from_pointer(p), s);
 }
 static void make_mem_bad(void *p, size_t s) {
-  __hwasan_tag_memory(p, ~__hwasan_get_tag_from_pointer(p), s);
+  uint8_t tag = ~__hwasan_get_tag_from_pointer(p);
+  if (!tag) {
+    // Nothing wrong with tag zero, but non-zero tags help to detect never
+    // tagged memory.
+    tag = 1;
+  }
+  __hwasan_tag_memory(p, , s);
----------------
thurstond wrote:

Is this missing the tag parameter?

https://github.com/llvm/llvm-project/pull/75280


More information about the llvm-branch-commits mailing list