[PATCH] D131914: [ubsan-minimal] Report the address of an error

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 14:10:06 PDT 2022


ikudrin added inline comments.


================
Comment at: compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp:55
 
+__attribute__((noinline)) static void decorate_msg(char *buf,
+                                                   __sanitizer::uptr caller) {
----------------
vitalybuka wrote:
> why do we need noinline here?
`report_this_error()` has the attribute, so I decided to follow that here. It seems to correspond to the intention to make the library as small as possible.


================
Comment at: compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp:105
+static const unsigned int kMaxAddrBuf = SANITIZER_WORDSIZE / 4;
+#define MSG_TMPL(msg) "ubsan: " msg " @"
+#define MSG_TMPL_END(buf, msg) (buf + sizeof(MSG_TMPL(msg)) - 1)
----------------
vitalybuka wrote:
> vitalybuka wrote:
> > Can we have "@" -> "at 0x"?
> > Can we have "@" -> "at 0x"?
> 
> Looks like we mostly use "at" for load/store location
> maybe "@" -> "by 0x", then it would be clear that this is the code
Changed to "by 0x".


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

https://reviews.llvm.org/D131914



More information about the llvm-commits mailing list