OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 /* CRASH() - Raises a fatal error resulting in program termination and triggerin
g either the debugger or the crash reporter. | 137 /* CRASH() - Raises a fatal error resulting in program termination and triggerin
g either the debugger or the crash reporter. |
138 | 138 |
139 Use CRASH() in response to known, unrecoverable errors like out-of-memory. | 139 Use CRASH() in response to known, unrecoverable errors like out-of-memory. |
140 Macro is enabled in both debug and release mode. | 140 Macro is enabled in both debug and release mode. |
141 To test for unknown errors and verify assumptions, use ASSERT instead, to avo
id impacting performance in release builds. | 141 To test for unknown errors and verify assumptions, use ASSERT instead, to avo
id impacting performance in release builds. |
142 | 142 |
143 Signals are ignored by the crash reporter on OS X so we must do better. | 143 Signals are ignored by the crash reporter on OS X so we must do better. |
144 */ | 144 */ |
145 #ifndef CRASH | 145 #ifndef CRASH |
146 #if COMPILER(MSVC) | 146 #if COMPILER(MSVC) |
147 #if COMPILER(CLANG) | 147 #define CRASH() (__debugbreak(), IMMEDIATE_CRASH()) |
148 #define CRASH() (__debugbreak(), __builtin_unreachable()) | |
149 #else | |
150 #define CRASH() __debugbreak() | |
151 #endif | |
152 #else | 148 #else |
153 #define CRASH() \ | 149 #define CRASH() \ |
154 (WTFReportBacktrace(), \ | 150 (WTFReportBacktrace(), \ |
155 (*(int*)0xfbadbeef = 0), \ | 151 (*(int*)0xfbadbeef = 0), \ |
156 IMMEDIATE_CRASH()) | 152 IMMEDIATE_CRASH()) |
157 #endif | 153 #endif |
158 #endif | 154 #endif |
159 | 155 |
160 #if COMPILER(CLANG) | 156 #if COMPILER(CLANG) |
161 #define NO_RETURN_DUE_TO_CRASH NO_RETURN | 157 #define NO_RETURN_DUE_TO_CRASH NO_RETURN |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 } \ | 397 } \ |
402 inline const thisType& to##thisType(const argumentType& argumentName) \ | 398 inline const thisType& to##thisType(const argumentType& argumentName) \ |
403 { \ | 399 { \ |
404 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ | 400 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ |
405 return static_cast<const thisType&>(argumentName); \ | 401 return static_cast<const thisType&>(argumentName); \ |
406 } \ | 402 } \ |
407 void to##thisType(const thisType*); \ | 403 void to##thisType(const thisType*); \ |
408 void to##thisType(const thisType&) | 404 void to##thisType(const thisType&) |
409 | 405 |
410 #endif /* WTF_Assertions_h */ | 406 #endif /* WTF_Assertions_h */ |
OLD | NEW |