On Mon, Oct 15, 2012 at 11:12 PM, Jakub Jelinek <ja...@redhat.com> wrote: > On Mon, Oct 15, 2012 at 10:48:13PM -0700, Xinliang David Li wrote: >> Another error checking feature is to poison stack vars on entry and >> exit of the lexical scope to catch uninit variable reference and out >> of scope references: >> >> S* sp; >> { >> S s; >> sp = &s; >> } >> .. *sp ... >> >> This is relatively easy to do in gcc thanks to the clobber statement. >> In Clang/LLVM, it is in the wishlist: >> http://code.google.com/p/address-sanitizer/issues/detail?id=83 > > That is not easy at all unfortunately, CLOBBER isn't sufficient for that. > You have the points where the variable looses value, but there aren't > similar markup statement where it gets into scope again. > See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54770#c3
I don't get it. Clobber marks the end of lifetime of a variable so it is safe to emit code to really clobber its value -- otherwise how would clobber based slot sharing work? David > > Jakub