Googletest export

Fix undefined pointer comparison

PiperOrigin-RevId: 334436975
This commit is contained in:
dmauro 2020-09-29 15:27:38 -04:00 committed by Andy Getz
parent 2ff8d94d0e
commit 477998eefa

View File

@ -32,6 +32,7 @@
#include "gtest/gtest-death-test.h"
#include <functional>
#include <utility>
#include "gtest/internal/gtest-port.h"
@ -1282,7 +1283,7 @@ GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
static void StackLowerThanAddress(const void* ptr, bool* result) {
int dummy = 0;
*result = (&dummy < ptr);
*result = std::less<const void*>()(&dummy, ptr);
}
// Make sure AddressSanitizer does not tamper with the stack here.