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

Kostya Serebryany kcc at google.com
Fri Nov 30 04:55:50 PST 2012



================
Comment at: lib/asan/asan_poisoning.cc:167
@@ +166,3 @@
+  s8 end_value = *shadow_end;
+  if (do_poison) {
+    // If possible, mark all the bytes mapping to last shadow byte as
----------------
Can we simplify the logic here? 
E.g. if (do_poison) we can easily poison an extra byte unconditionally. 
if (!do_poison) maybe we can use PoisonShadowPartialRightRedzone? 


================
Comment at: lib/asan/lit_tests/use-after-scope-inlined.cc:1
@@ +1,2 @@
+// Test with "-O2" only to make sure inlining (leading to use-after-scope)
+// happens. "always_inline" is not enough, as Clang doesn't emit
----------------
use-after-scope feature deserves a more extensive set test, 
probably in form of large list of DEATH_TESTS (like in asan_test.cc)
in a separate file, asan_lifetime_test.cc 
That could go as a separate commit. 


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



More information about the llvm-commits mailing list