[PATCH] D56603: [HWASAN] Improve tag-mismatch diagnostics

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 14 16:48:55 PST 2019


eugenis added inline comments.


================
Comment at: lib/hwasan/hwasan_checks.h:27
   // brk immediate.
-  // FIXME: Add a constraint to put the pointer into x0, the same as x86 branch.
-  asm("brk %0\n\t" ::"n"(0x900 + X));
+  asm("ldr X0, %0\nbrk %1\n\t" ::"g"(p), "n"(0x900 + X));
 #elif defined(__x86_64__)
----------------
this can be done better with register asm:
  register uptr x0 asm("x0") = p;
and then use "r"(x0) in asm constraints.

It would also tell the compiler that x0 is clobbered, which might matter in the -fsanitize-recover mode.


================
Comment at: lib/hwasan/hwasan_report.cc:408
+  // correct tag
+  uptr granule = untagged_addr;
+  for (; *tag_ptr == ptr_tag;
----------------
Reuse __hwasan_test_shadow.


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

https://reviews.llvm.org/D56603





More information about the llvm-commits mailing list