[PATCH] D11283: runtime flag for use-after dtor and v simple runtime test

Evgeniy Stepanov eugenis at google.com
Fri Jul 17 13:25:25 PDT 2015


eugenis accepted this revision.
eugenis added a comment.
This revision is now accepted and ready to land.

LGTM


================
Comment at: lib/msan/msan_interceptors.cc:1011
@@ +1010,3 @@
+  if (flags()->poison_in_dtor) {
+    stack.tag = STACK_TRACE_TAG_POISON;
+    PoisonMemory(data, size, &stack);
----------------
FYI, this tag affects the wording of MSan reports. We may want to introduce a new tag, specifically for use-after-dtor. Not in this commit.


================
Comment at: test/msan/dtor-member.cc:11
@@ +10,3 @@
+// RUN: %clangxx_msan %s -fsanitize=memory -o %t && MSAN_OPTIONS=poison_in_dtor=1  %run %t >%t.out 2>&1
+// RUN: FileCheck %s --check-prefix=CHECK-NO-COMPILE-FLAG < %t.out
+
----------------
Could just call it "CHECK-NO" and save one line of code.

================
Comment at: test/msan/dtor-member.cc:18
@@ +17,3 @@
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
----------------
I don't think this include is needed.

================
Comment at: test/msan/dtor-member.cc:36
@@ +35,3 @@
+  // memory location &buf. Since objects made in this way must be explicitly
+  // destroyed, there are no implicit calls inserted that would interfer with
+  // test behavior.
----------------
"interfere"


http://reviews.llvm.org/D11283







More information about the cfe-commits mailing list