[llvm-commits] [PATCH] AddressSanitizer: runtime support for use-after-scope bugs.

Kostya Serebryany kcc at google.com
Wed Nov 28 04:15:45 PST 2012



================
Comment at: include/sanitizer/asan_interface.h:73
@@ +72,3 @@
+  // function exits.
+  void __asan_stack_poison_memory(uptr addr, uptr size)
+      SANITIZER_INTERFACE_ATTRIBUTE;
----------------
Hmm... Maybe __asan_poison_stack_memory() ? 

================
Comment at: lib/asan/asan_poisoning.cc:170
@@ +169,3 @@
+void __asan_stack_poison_memory(uptr addr, uptr size) {
+  PoisonMemoryRegion(addr, size, kAsanStackUseAfterScopeMagic);
+}
----------------
Isn't  PoisonMemoryRegion too complex for our task? 
With use-after-scope we are dealing with the allocas that are created by the asan pass, and so they are properly aligned on both ends. 

================
Comment at: lib/asan/lit_tests/use-after-scope-inlined.cc:12
@@ +11,3 @@
+
+void inlined(int arg) {
+  int x[5];
----------------
I would still mark it with always_inline attribute


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



More information about the llvm-commits mailing list