"git@developer.sourcefind.cn:yangql/googletest.git" did not exist on "287b37f23f534a0f9b1eb6072c882cbcaaffc097"
Commit a4007e94 authored by Abseil Team's avatar Abseil Team Committed by Mark Barolak
Browse files

Googletest export

Make sure sanitizers do not tamper with the stack here in StackLowerThanAddress().

PiperOrigin-RevId: 318082465
parent 5e0cf72b
......@@ -1284,8 +1284,13 @@ static int ExecDeathTestChildMain(void* child_arg) {
// correct answer.
static void StackLowerThanAddress(const void* ptr,
bool* result) GTEST_NO_INLINE_;
// Make sure sanitizers do not tamper with the stack here.
// Ideally, we want to use `__builtin_frame_address` instead of a local variable
// address with sanitizer disabled, but it does not work when the
// compiler optimizes the stack frame out, which happens on PowerPC targets.
// HWAddressSanitizer add a random tag to the MSB of the local variable address,
// making comparison result unpredictable.
GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
static void StackLowerThanAddress(const void* ptr, bool* result) {
int dummy;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment