From 83b719e51a4c393fb6dd7e5ecdcb3515b5f26b9d Mon Sep 17 00:00:00 2001 From: Stephen Neuendorffer Date: Sat, 11 Jul 2020 11:47:07 -0700 Subject: [PATCH] [examples] fix ExceptionDemo Code didn't compile in a release build. Guard debug output with ifndef NDEBUG. Differential Revision: https://reviews.llvm.org/D83628 --- examples/ExceptionDemo/ExceptionDemo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp index 0ecb527f4ec..1b3ec7c91dd 100644 --- a/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/examples/ExceptionDemo/ExceptionDemo.cpp @@ -792,7 +792,7 @@ _Unwind_Reason_Code ourPersonality(int version, _Unwind_Action actions, } #endif - const uint8_t *lsda = _Unwind_GetLanguageSpecificData(context); + const uint8_t *lsda = (const uint8_t *)_Unwind_GetLanguageSpecificData(context); #ifdef DEBUG fprintf(stderr, @@ -1959,11 +1959,13 @@ int main(int argc, char *argv[]) { executionEngine->finalizeObject(); +#ifndef NDEBUG fprintf(stderr, "\nBegin module dump:\n\n"); module->dump(); fprintf(stderr, "\nEnd module dump:\n"); +#endif fprintf(stderr, "\n\nBegin Test:\n");