Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: core/fxcrt/include/fx_system.h

Issue 1986453002: Fix binding of null pointer dereference to reference type (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Use Blink/V8-style IMMEDIATE_CRASH instead" Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxcrt/include/fx_basic.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/include/fx_system.h
diff --git a/core/fxcrt/include/fx_system.h b/core/fxcrt/include/fx_system.h
index 205976fb15fdb8baff7005cda74cc91595246be5..4cf1ceabef76eff95af50197c2ffd678e3196ed2 100644
--- a/core/fxcrt/include/fx_system.h
+++ b/core/fxcrt/include/fx_system.h
@@ -103,6 +103,14 @@ static_assert(FALSE == false, "false_needs_to_be_false");
#endif
#endif
+#ifndef IMMEDIATE_CRASH
Nico 2016/05/16 18:11:29 hm, giving this the same name as blink's macro is
hans 2016/05/16 18:22:18 Done.
+#if defined(__clang__) || defined(__GNUC__)
+#define IMMEDIATE_CRASH() __builtin_trap()
+#else
+#define IMMEDIATE_CRASH() ((void)(*(volatile char*)0 = 0))
+#endif
+#endif
+
// M_PI not universally present on all platforms.
#define FX_PI 3.1415926535897932384626433832795f
#define FX_BEZIER 0.5522847498308f
« no previous file with comments | « core/fxcrt/include/fx_basic.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698