[PATCH] [asan] Wipe all poisoned memory in fake stack frames before passing them to LSan

Kostya Serebryany kcc at google.com
Fri Oct 25 04:25:11 PDT 2013



================
Comment at: lib/asan/asan_fake_stack.cc:157
@@ +156,3 @@
+  uptr poisoned_begin = 0;
+  while (ptr < end) {
+    u8 shadow = *shadow_ptr;
----------------
why not a for() loop? 

================
Comment at: lib/asan/asan_fake_stack.cc:151
@@ -150,1 +150,3 @@
 
+void FakeStack::WipePoisonedCallback(uptr begin, uptr end, void *arg) {
+  uptr ptr = begin + sizeof(FakeFrame);
----------------
an extended comment explaining what and why we are doing here would help.
also please add comments in if/else parts of loop body, otherwise it's hard to follow even to me.


http://llvm-reviews.chandlerc.com/D1962



More information about the llvm-commits mailing list