[PATCH] D149252: [hwasan] fix false positive when hwasan-match-all-tag flag is enabled and short granules are used

Mingjie Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 20:41:25 PDT 2023


Enna1 updated this revision to Diff 517442.
Enna1 added a comment.

- only test


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149252/new/

https://reviews.llvm.org/D149252

Files:
  compiler-rt/test/hwasan/TestCases/short-granule-and-match-all-tag.cpp


Index: compiler-rt/test/hwasan/TestCases/short-granule-and-match-all-tag.cpp
===================================================================
--- /dev/null
+++ compiler-rt/test/hwasan/TestCases/short-granule-and-match-all-tag.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_hwasan -mllvm -hwasan-match-all-tag=0 %s -o %t && %run %t
+
+#include <sanitizer/hwasan_interface.h>
+#include <stdlib.h>
+
+int main() {
+  __hwasan_enable_allocator_tagging();
+  char *x = (char *)malloc(40);
+  char volatile z = *x;
+  free(x);
+  return 0;
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149252.517442.patch
Type: text/x-patch
Size: 530 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230427/98b35cdc/attachment.bin>


More information about the llvm-commits mailing list