[PATCH] D139686: [lsan] Add lsan support for loongarch64

WÁNG Xuěruì via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 8 19:09:47 PST 2022


xen0n added inline comments.


================
Comment at: compiler-rt/lib/lsan/lsan_common.cpp:281
+#  elif defined(__loongarch_lp64)
+  return ((p >> 47) == 0);
 #  else
----------------
Since our VM layout is actually flexible, would it be better to document this, like "Support only the most common VM layout on LoongArch that allows 47 bits of user-space VMA"? Exact wording could be optimized, I'm only describing the gist here.


================
Comment at: compiler-rt/test/asan/TestCases/Linux/leak_check_segv.cpp:4
 // REQUIRES: leak-detection
-#include <stdlib.h>
+#include <sanitizer/lsan_interface.h>
 #include <stdio.h>
----------------
Why unnecessarily reorder things, especially putting this //in front of// the standard library includes?


================
Comment at: compiler-rt/test/asan/TestCases/Linux/leak_check_segv.cpp:20-21
+           16 * 1024, PROT_NONE);
+  mprotect((void *)(((unsigned long)data + kPageSize - 1) & ~(kPageSize - 1)),
+           16 * 1024, PROT_NONE);
   __lsan_do_leak_check();
----------------
Might be better to split this part of change out of the LoongArch enablement patch after all...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139686



More information about the cfe-commits mailing list