forked from OSchip/llvm-project
[Msan] Improve the EXPECT_NOT_POISONED() macro to provide the original line number
Differential Revision: http://reviews.llvm.org/D7341 llvm-svn: 229389
This commit is contained in:
parent
b1f54eeed4
commit
37a79210cb
|
@ -168,11 +168,11 @@ void ExpectPoisonedWithOrigin(const T& t, unsigned origin) {
|
|||
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];
|
||||
|
|
Loading…
Reference in New Issue