[PATCH] [Msan] Improve the EXPECT_NOT_POISONED() macro to provide the original line number

Viktor Kutuzov vkutuzov at accesssoftek.com
Mon Feb 2 05:30:43 PST 2015


Hi kcc, samsonov, eugenis,

Once this patch is committed, I will prepare the patch for the rest of the assertion macros.

http://reviews.llvm.org/D7341

Files:
  lib/msan/tests/msan_test.cc

Index: lib/msan/tests/msan_test.cc
===================================================================
--- lib/msan/tests/msan_test.cc
+++ lib/msan/tests/msan_test.cc
@@ -156,11 +156,11 @@
     EXPECT_EQ(origin, __msan_get_origin((void*)&t));
 }
 
-#define EXPECT_NOT_POISONED(x) ExpectNotPoisoned(x)
+#define EXPECT_NOT_POISONED(x) EXPECT_EQ(true, TestForNotPoisoned((x)))
 
 template<typename T>
-void ExpectNotPoisoned(const T& t) {
-  EXPECT_EQ(-1, __msan_test_shadow((void*)&t, sizeof(t)));
+bool TestForNotPoisoned(const T& t) {
+  return __msan_test_shadow((void*)&t, sizeof(t)) == -1;
 }
 
 static U8 poisoned_array[100];

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7341.19147.patch
Type: text/x-patch
Size: 630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150202/3ce410fd/attachment.bin>


More information about the llvm-commits mailing list