diff options
-rw-r--r-- | src/client/linux/handler/exception_handler_unittest.cc | 7 | ||||
-rw-r--r-- | src/client/mac/tests/exception_handler_test.cc | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc index 289c9cd1..b4065b41 100644 --- a/src/client/linux/handler/exception_handler_unittest.cc +++ b/src/client/linux/handler/exception_handler_unittest.cc @@ -774,8 +774,13 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryNullPointer) { true, -1); // Try calling a NULL pointer. typedef void (*void_function)(void); - void_function memory_function = reinterpret_cast<void_function>(NULL); + // Volatile markings are needed to keep Clang from generating invalid + // opcodes. See http://crbug.com/498354 for details. + volatile void_function memory_function = + reinterpret_cast<void_function>(NULL); memory_function(); + // not reached + exit(1); } close(fds[1]); diff --git a/src/client/mac/tests/exception_handler_test.cc b/src/client/mac/tests/exception_handler_test.cc index e19944d0..a8cf6968 100644 --- a/src/client/mac/tests/exception_handler_test.cc +++ b/src/client/mac/tests/exception_handler_test.cc @@ -610,7 +610,9 @@ TEST_F(ExceptionHandlerTest, InstructionPointerMemoryNullPointer) { ExceptionHandler eh(tempDir.path(), NULL, MDCallback, &fds[1], true, NULL); // Try calling a NULL pointer. typedef void (*void_function)(void); - void_function memory_function = + // Volatile markings are needed to keep Clang from generating invalid + // opcodes. See http://crbug.com/498354 for details. + volatile void_function memory_function = reinterpret_cast<void_function>(NULL); memory_function(); // not reached |