On Fri, Nov 15, 2013 at 10:34:28PM +0400, Konstantin Serebryany wrote: > +samsonov, who wrote the clang part > > Do you plan to add tests?
OT, what is the -fsanitize=address,use-after-scope doing? Tried that and it didn't seem to do anything at all, besides adding some extra start/end scope markers to the IL, but not actually adding any instrumentation. Is that just not done yet? What are you planning for that? For a subset of vars poison them upon entry to the function and then when entering their scope unpoison them and when leaving scope poison them again? GCC right now has just var ={v} {CLOBBER}; statements that mark vars going out of scope, we could add for asan only add also into scope markers, make sure they are never optimized away (current CLOBBERs are just optimization hints and in some cases it is better to optimize them away rather than e.g. get worse EH code), but because they are used for optimizations, programs with use-after-scope bugs often get miscompiled by GCC (well, they have undefined behavior, so miscompiled is a weird term), it would be nice to have asan complain about those. Jakub