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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « core/fxcrt/include/fx_basic.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_FXCRT_INCLUDE_FX_SYSTEM_H_ 7 #ifndef CORE_FXCRT_INCLUDE_FX_SYSTEM_H_
8 #define CORE_FXCRT_INCLUDE_FX_SYSTEM_H_ 8 #define CORE_FXCRT_INCLUDE_FX_SYSTEM_H_
9 9
10 #include <assert.h> 10 #include <assert.h>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 #endif 96 #endif
97 97
98 #ifndef ASSERT 98 #ifndef ASSERT
99 #ifndef NDEBUG 99 #ifndef NDEBUG
100 #define ASSERT assert 100 #define ASSERT assert
101 #else 101 #else
102 #define ASSERT(a) 102 #define ASSERT(a)
103 #endif 103 #endif
104 #endif 104 #endif
105 105
106 #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.
107 #if defined(__clang__) || defined(__GNUC__)
108 #define IMMEDIATE_CRASH() __builtin_trap()
109 #else
110 #define IMMEDIATE_CRASH() ((void)(*(volatile char*)0 = 0))
111 #endif
112 #endif
113
106 // M_PI not universally present on all platforms. 114 // M_PI not universally present on all platforms.
107 #define FX_PI 3.1415926535897932384626433832795f 115 #define FX_PI 3.1415926535897932384626433832795f
108 #define FX_BEZIER 0.5522847498308f 116 #define FX_BEZIER 0.5522847498308f
109 117
110 // NOTE: prevent use of the return value from snprintf() since some platforms 118 // NOTE: prevent use of the return value from snprintf() since some platforms
111 // have different return values (e.g. windows _vsnprintf()), and provide 119 // have different return values (e.g. windows _vsnprintf()), and provide
112 // versions that always NUL-terminate. 120 // versions that always NUL-terminate.
113 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 121 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900
114 void FXSYS_snprintf(char* str, 122 void FXSYS_snprintf(char* str,
115 size_t size, 123 size_t size,
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 334
327 // Prevent a function from ever being inlined, typically because we'd 335 // Prevent a function from ever being inlined, typically because we'd
328 // like it to appear in stack traces. 336 // like it to appear in stack traces.
329 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 337 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
330 #define NEVER_INLINE __declspec(noinline) 338 #define NEVER_INLINE __declspec(noinline)
331 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 339 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
332 #define NEVER_INLINE __attribute__((__noinline__)) 340 #define NEVER_INLINE __attribute__((__noinline__))
333 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 341 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
334 342
335 #endif // CORE_FXCRT_INCLUDE_FX_SYSTEM_H_ 343 #endif // CORE_FXCRT_INCLUDE_FX_SYSTEM_H_
OLDNEW
« 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