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

Alexey Samsonov samsonov at google.com
Wed Nov 28 14:35:47 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;
----------------
Kostya Serebryany wrote:
> Hmm... Maybe __asan_poison_stack_memory() ? 
Done.

================
Comment at: lib/asan/asan_poisoning.cc:170
@@ +169,3 @@
+void __asan_stack_poison_memory(uptr addr, uptr size) {
+  PoisonMemoryRegion(addr, size, kAsanStackUseAfterScopeMagic);
+}
----------------
Kostya Serebryany wrote:
> 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. 
Why is it? If the memory region is aligned, we just skip special cases for ends of region and do a plain memset.

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


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



More information about the llvm-commits mailing list