Chromium Code Reviews| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 #endif | 282 #endif |
| 283 | 283 |
| 284 /* RELEASE_ASSERT | 284 /* RELEASE_ASSERT |
| 285 | 285 |
| 286 Use in places where failure of an assertion indicates a definite security | 286 Use in places where failure of an assertion indicates a definite security |
| 287 vulnerability from which execution must not continue even in a release build. | 287 vulnerability from which execution must not continue even in a release build. |
| 288 Please sure to file bugs for these failures using the security template: | 288 Please sure to file bugs for these failures using the security template: |
| 289 http://code.google.com/p/chromium/issues/entry?template=Security%20Bug | 289 http://code.google.com/p/chromium/issues/entry?template=Security%20Bug |
| 290 */ | 290 */ |
| 291 // RELEASE_ASSERT is deprecated. We should use CHECK() instead. | 291 // RELEASE_ASSERT is deprecated. We should use CHECK() instead. |
| 292 #if defined(ADDRESS_SANITIZER) | |
|
inferno
2016/08/12 17:43:56
This should come after #if ENABLE(ASSERT) block in
| |
| 293 #define RELEASE_ASSERT_FOR_FUZZING() do { \ | |
| 294 WTFLogAlways("RELEASE_ASSERT failed.\n"); \ | |
|
inferno
2016/08/12 17:43:56
We would need to get condition failed and stacktra
| |
| 295 IMMEDIATE_CRASH(); \ | |
| 296 } while (0) | |
| 297 #define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (RELEASE_ASSERT_FOR_ FUZZING()) : (void)0) | |
| 298 #else // defined(ADDRESS_SANITIZER) | |
| 292 #if ENABLE(ASSERT) | 299 #if ENABLE(ASSERT) |
| 293 #define RELEASE_ASSERT(assertion) ASSERT(assertion) | 300 #define RELEASE_ASSERT(assertion) ASSERT(assertion) |
| 294 #else | 301 #else |
| 295 #define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH()) : (void)0) | 302 #define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH()) : (void)0) |
| 296 #endif | 303 #endif |
| 304 #endif // defined(ADDRESS_SANITIZER) | |
| 297 // TODO(tkent): Move this to base/logging.h? | 305 // TODO(tkent): Move this to base/logging.h? |
| 298 #define RELEASE_NOTREACHED() LOG(FATAL) | 306 #define RELEASE_NOTREACHED() LOG(FATAL) |
| 299 | 307 |
| 300 /* DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES */ | 308 /* DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES */ |
| 301 | 309 |
| 302 // Allow equality comparisons of Objects by reference or pointer, interchangeabl y. | 310 // Allow equality comparisons of Objects by reference or pointer, interchangeabl y. |
| 303 // This can be only used on types whose equality makes no other sense than point er equality. | 311 // This can be only used on types whose equality makes no other sense than point er equality. |
| 304 #define DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(thisType) \ | 312 #define DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(thisType) \ |
| 305 inline bool operator==(const thisType& a, const thisType& b) { return &a == &b; } \ | 313 inline bool operator==(const thisType& a, const thisType& b) { return &a == &b; } \ |
| 306 inline bool operator==(const thisType& a, const thisType* b) { return &a == b; } \ | 314 inline bool operator==(const thisType& a, const thisType* b) { return &a == b; } \ |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 336 } \ | 344 } \ |
| 337 inline const thisType& to##thisType(const argumentType& argumentName) \ | 345 inline const thisType& to##thisType(const argumentType& argumentName) \ |
| 338 { \ | 346 { \ |
| 339 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ | 347 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ |
| 340 return static_cast<const thisType&>(argumentName); \ | 348 return static_cast<const thisType&>(argumentName); \ |
| 341 } \ | 349 } \ |
| 342 void to##thisType(const thisType*); \ | 350 void to##thisType(const thisType*); \ |
| 343 void to##thisType(const thisType&) | 351 void to##thisType(const thisType&) |
| 344 | 352 |
| 345 #endif /* WTF_Assertions_h */ | 353 #endif /* WTF_Assertions_h */ |
| OLD | NEW |