diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-04-12 12:58:29 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-04-12 17:30:06 +0200 |
commit | fd09b7d9b54ccb4d737747ee7fba26f15f4901cd (patch) | |
tree | cb8b68211b0eff5c2b4927182c93749b053edb71 /src/3rdparty/masm/wtf/Assertions.h | |
parent | 89be8e111c34bf6e96710e574c251587dd59f42b (diff) |
WTF/JSC update to r148273
This brings in various bug fixes in the ARM and MIPS assemblers as well as
a Yarr crash fix and performance fix.
This change doesn't compile as-is, but the next change will
apply the modifications necessary to compile. That'll make future updates
easier as it allows for cherry-picking because the modifications are usually
always the same.
Change-Id: Iac32f62c71e8ff908deb41f28f12fbc98c0823e1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/masm/wtf/Assertions.h')
-rw-r--r-- | src/3rdparty/masm/wtf/Assertions.h | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/3rdparty/masm/wtf/Assertions.h b/src/3rdparty/masm/wtf/Assertions.h index 7e079ab187..6263e50ed9 100644 --- a/src/3rdparty/masm/wtf/Assertions.h +++ b/src/3rdparty/masm/wtf/Assertions.h @@ -213,7 +213,7 @@ WTF_EXPORT_PRIVATE void WTFInstallReportBacktraceOnCrashHook(); Expressions inside them are evaluated in debug builds only. */ -#if OS(WINCE) && !PLATFORM(TORCHMOBILE) +#if OS(WINCE) /* FIXME: We include this here only to avoid a conflict with the ASSERT macro. */ #include <windows.h> #undef min @@ -266,6 +266,28 @@ inline void assertUnused(T& x) { (void)x; } #endif +/* ASSERT_WITH_SECURITY_IMPLICATION + + Failure of this assertion indicates a possible security vulnerability. + Class of vulnerabilities that it tests include bad casts, out of bounds + accesses, use-after-frees, etc. Please file a bug using the security + template - https://bugs.webkit.org/enter_bug.cgi?product=Security. + +*/ +#ifdef ADDRESS_SANITIZER + +#define ASSERT_WITH_SECURITY_IMPLICATION(assertion) \ + (!(assertion) ? \ + (WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion), \ + CRASH()) : \ + (void)0) + +#else + +#define ASSERT_WITH_SECURITY_IMPLICATION(assertion) ASSERT(assertion) + +#endif + /* ASSERT_WITH_MESSAGE */ #if COMPILER(MSVC7_OR_LOWER) @@ -323,7 +345,10 @@ while (0) /* COMPILE_ASSERT */ #ifndef COMPILE_ASSERT #if COMPILER_SUPPORTS(C_STATIC_ASSERT) +/* Unlike static_assert below, this also works in plain C code. */ #define COMPILE_ASSERT(exp, name) _Static_assert((exp), #name) +#elif COMPILER_SUPPORTS(CXX_STATIC_ASSERT) +#define COMPILE_ASSERT(exp, name) static_assert((exp), #name) #else #define COMPILE_ASSERT(exp, name) typedef int dummy##name [(exp) ? 1 : -1] #endif @@ -390,4 +415,14 @@ static inline void UNREACHABLE_FOR_PLATFORM() #define UNREACHABLE_FOR_PLATFORM() ASSERT_NOT_REACHED() #endif +#if ASSERT_DISABLED +#define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (CRASH()) : (void)0) +#define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion) +#define RELEASE_ASSERT_NOT_REACHED() CRASH() +#else +#define RELEASE_ASSERT(assertion) ASSERT(assertion) +#define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertion, __VA_ARGS__) +#define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED() +#endif + #endif /* WTF_Assertions_h */ |