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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 /* IMMEDIATE_CRASH() - Like CRASH() below but crashes in the fastest, simplest p
ossible way with no attempt at logging. */ | 128 /* IMMEDIATE_CRASH() - Like CRASH() below but crashes in the fastest, simplest p
ossible way with no attempt at logging. */ |
129 #ifndef IMMEDIATE_CRASH | 129 #ifndef IMMEDIATE_CRASH |
130 #if COMPILER(GCC) | 130 #if COMPILER(GCC) |
131 #define IMMEDIATE_CRASH() __builtin_trap() | 131 #define IMMEDIATE_CRASH() __builtin_trap() |
132 #else | 132 #else |
133 #define IMMEDIATE_CRASH() ((void(*)())0)() | 133 #define IMMEDIATE_CRASH() ((void(*)())0)() |
134 #endif | 134 #endif |
135 #endif | 135 #endif |
136 | 136 |
| 137 // IMMEDIATE_CRASH_WITH_FLAG() - Like IMMEDIATE_CRASH() above but try to crash a
t a specified address to be distinguished in crash reports. |
| 138 #ifndef IMMEDIATE_CRASH_WITH_FLAG |
| 139 #if COMPILER(GCC) |
| 140 #define IMMEDIATE_CRASH_WITH_FLAG(FLAG) IMMEDIATE_CRASH() |
| 141 #else |
| 142 #define IMMEDIATE_CRASH_WITH_FLAG(FLAG) (((void(*)())((FLAG) & 0xfff))(), IMMEDI
ATE_CRASH()) |
| 143 #endif |
| 144 #endif |
| 145 |
137 /* CRASH() - Raises a fatal error resulting in program termination and triggerin
g either the debugger or the crash reporter. | 146 /* CRASH() - Raises a fatal error resulting in program termination and triggerin
g either the debugger or the crash reporter. |
138 | 147 |
139 Use CRASH() in response to known, unrecoverable errors like out-of-memory. | 148 Use CRASH() in response to known, unrecoverable errors like out-of-memory. |
140 Macro is enabled in both debug and release mode. | 149 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. | 150 To test for unknown errors and verify assumptions, use ASSERT instead, to avo
id impacting performance in release builds. |
142 | 151 |
143 Signals are ignored by the crash reporter on OS X so we must do better. | 152 Signals are ignored by the crash reporter on OS X so we must do better. |
144 */ | 153 */ |
145 #ifndef CRASH | 154 #ifndef CRASH |
146 #define CRASH() \ | 155 #define CRASH() \ |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 } \ | 414 } \ |
406 inline const thisType& to##thisType(const argumentType& argumentName) \ | 415 inline const thisType& to##thisType(const argumentType& argumentName) \ |
407 { \ | 416 { \ |
408 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ | 417 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ |
409 return static_cast<const thisType&>(argumentName); \ | 418 return static_cast<const thisType&>(argumentName); \ |
410 } \ | 419 } \ |
411 void to##thisType(const thisType*); \ | 420 void to##thisType(const thisType*); \ |
412 void to##thisType(const thisType&) | 421 void to##thisType(const thisType&) |
413 | 422 |
414 #endif /* WTF_Assertions_h */ | 423 #endif /* WTF_Assertions_h */ |
OLD | NEW |