[PATCH] D32197: [TySan] A Type Sanitizer (Runtime Library)

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 10 12:35:02 PST 2023


fhahn added inline comments.


================
Comment at: compiler-rt/lib/tysan/tysan.cpp:70
+      printTDName(td->Member.Base);
+      Printf(" at offset %u)", td->Member.Offset);
+    }
----------------
Enna1 wrote:
> %zu
Should be fixed, thanks!


================
Comment at: compiler-rt/lib/tysan/tysan.cpp:122
+      if (!TDA->Struct.MemberCount) {
+        DCHECK(0);
+        break;
----------------
Enna1 wrote:
> This line will be executed when TDA points to __tysan_v1_Simple_20C_2fC_2b_2b_20TBAA.
> I suggest ether remove this `DCHECK(0)` or replace it with
> ```
> if (Verbosity())
>   Report("Reach root type descriptor\n");
> ```
Thanks for checking, I updated the code to remove the DCHECK and added a comment.


================
Comment at: compiler-rt/lib/tysan/tysan.cpp:173
+  Report("ERROR: TypeSanitizer: type-aliasing-violation on address %p"
+         " (pc %p bp %p sp %p tid %d)\n",
+         Addr, (void *)pc, (void *)bp, (void *)sp, GetTid());
----------------
Enna1 wrote:
> %llu
> 
Updated. thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D32197



More information about the llvm-commits mailing list