diff options
author | Simon Hausmann <[email protected]> | 2013-10-17 10:45:13 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-10-17 11:36:32 +0200 |
commit | 4deb9338c595543580d2462dee889bcb7f7fc4d6 (patch) | |
tree | 4a2b7fbb8eca96f4e4475f03eb032be4775d3df4 /src | |
parent | 0640fbc8e53644facf199ab0bd3a7414cf149068 (diff) |
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/masm/assembler/MacroAssemblerCodeRef.h | 6 |
1 files changed, 2 insertions, 4 deletions
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<intptr_t>(ptr) & ~1); \ - ASSERT(reinterpret_cast<intptr_t>(ptr) & 1) + ASSERT(reinterpret_cast<intptr_t>(ptr) & ~1); #define ASSERT_VALID_CODE_OFFSET(offset) \ ASSERT(!(offset & 1)) // Must be multiple of 2. #else |