[PATCH] D38971: Enhance libsanitizer support for invalid-pointer-pair.

Kostya Serebryany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 08:25:59 PST 2017


kcc added a comment.

[sorry, I've been swamped]
Alexey, please make your round of reviews.



================
Comment at: lib/asan/asan_descriptions.cc:344
+    for (uptr j = 0; j < other.size; j++) {
+      if (globals[i].beg == other.globals[j].beg && globals[i].beg <= addr &&
+          other.globals[j].beg <= other.addr &&
----------------
I can't read this. 
Please refactor in a more readable way.
I suggest to do 
   a = globals[i]
   b = globals[j]
and implement lambda(s) to compute recurring subexpression(s)



================
Comment at: lib/asan/asan_report.cc:307
+  uptr right = a1 < a2 ? a2 : a1;
+  if (offset <= 2048)
+    return __asan_region_is_poisoned(left, offset);
----------------
define a 
   const uptr kMaxOffset = 2048; // Explain why 2048


https://reviews.llvm.org/D38971





More information about the llvm-commits mailing list