From 4deb9338c595543580d2462dee889bcb7f7fc4d6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 17 Oct 2013 10:45:13 +0200 Subject: Fix ASSERT_VALID_CODE_POINTER for our ARM builds We want to allow intermixing thumb and ARM for all builds, not only Android. Modified the macro to do a thumb-compatible null pointer check. This also works around a miscompilation on QNX where the compiler appeared to make incorrect assumptions about the address of functions we are taking. Change-Id: Ib8fc400178e0c2621bde2ca94b3f94041591e19a Reviewed-by: Lars Knoll --- src/3rdparty/masm/assembler/MacroAssemblerCodeRef.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/3rdparty/masm/assembler/MacroAssemblerCodeRef.h b/src/3rdparty/masm/assembler/MacroAssemblerCodeRef.h index b699316b91..f03254aa38 100644 --- a/src/3rdparty/masm/assembler/MacroAssemblerCodeRef.h +++ b/src/3rdparty/masm/assembler/MacroAssemblerCodeRef.h @@ -37,16 +37,14 @@ // ASSERT_VALID_CODE_POINTER checks that ptr is a non-null pointer, and that it is a valid // instruction address on the platform (for example, check any alignment requirements). -// (Disabled checks on Android/ARM because we want to intermix thumb and arm) -#if CPU(ARM_THUMB2) && !defined(Q_OS_ANDROID) +#if CPU(ARM_THUMB2) // ARM/thumb instructions must be 16-bit aligned, but all code pointers to be loaded // into the processor are decorated with the bottom bit set, indicating that this is // thumb code (as oposed to 32-bit traditional ARM). The first test checks for both // decorated and undectorated null, and the second test ensures that the pointer is // decorated. #define ASSERT_VALID_CODE_POINTER(ptr) \ - ASSERT(reinterpret_cast(ptr) & ~1); \ - ASSERT(reinterpret_cast(ptr) & 1) + ASSERT(reinterpret_cast(ptr) & ~1); #define ASSERT_VALID_CODE_OFFSET(offset) \ ASSERT(!(offset & 1)) // Must be multiple of 2. #else -- cgit v1.2.3