[PATCH] D11092: use-after-dtor cmd option
Evgeniy Stepanov
eugenis at google.com
Thu Jul 9 17:38:10 PDT 2015
eugenis added a comment.
I suspect this does not do anything because you need to pass the flag from the driver to the compiler.
Compare with this change:
http://llvm.org/viewvc/llvm-project?view=revision&revision=219417
Please add a test, similar to r219417.
================
Comment at: include/clang/Driver/Options.td:558
@@ -557,1 +557,3 @@
HelpText<"Enable origins tracking in MemorySanitizer">;
+def fsanitize_memory_use_after_dtor : Flag<["-"], "fsanitize-memory-use-after-dtor">,
+ Group<f_clang_Group>, Flags<[CC1Option]>,
----------------
Move it below fno_sanitize_memory_track_origins
================
Comment at: include/clang/Frontend/CodeGenOptions.def:115
@@ -114,1 +114,3 @@
///< MemorySanitizer
+CODEGENOPT(SanitizeMemoryUseAfterDtor, 2, 0) ///< Enable use-after-delete detection
+ ///< in MemorySanitizer
----------------
"2" should be "1", this is just a bool flag
================
Comment at: lib/CodeGen/CGClass.cpp:1461
@@ +1460,3 @@
+ // insert destructor clean up here
+ EnterDtorPoisoning();
+ }
----------------
EmitDtorPoisoning
But better remove this for now and add a real implementation in another changelist.
http://reviews.llvm.org/D11092
More information about the cfe-commits
mailing list