From 06f457216f45093dc5dff12055733aa426c26c59 Mon Sep 17 00:00:00 2001 From: hans Date: Mon, 16 May 2016 12:25:44 -0700 Subject: Fix binding of null pointer dereference to reference type A new Clang warning complains about this, and especially for the function returning a reference, it seems like a bad idea. BUG=none Review-Url: https://codereview.chromium.org/1986453002 --- core/fxcrt/include/fx_system.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/fxcrt/include/fx_system.h') diff --git a/core/fxcrt/include/fx_system.h b/core/fxcrt/include/fx_system.h index 205976fb15..61acd73492 100644 --- a/core/fxcrt/include/fx_system.h +++ b/core/fxcrt/include/fx_system.h @@ -103,6 +103,12 @@ static_assert(FALSE == false, "false_needs_to_be_false"); #endif #endif +#if defined(__clang__) || defined(__GNUC__) +#define PDFIUM_IMMEDIATE_CRASH() __builtin_trap() +#else +#define PDFIUM_IMMEDIATE_CRASH() ((void)(*(volatile char*)0 = 0)) +#endif + // M_PI not universally present on all platforms. #define FX_PI 3.1415926535897932384626433832795f #define FX_BEZIER 0.5522847498308f -- cgit v1.2.3