From d0f3363aa8db533ba6fe356053caaf79a1507d14 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 17 Jan 2017 21:07:01 +0100 Subject: [PATCH] Fix patch The original patch caused compilation of x86-ffi64.c to fail, but that failure was silently ignored by the build. Change-Id: I93a0cde041b8f9546873d6cc30c1b690da098642 --- external/python3/ubsan.patch.0 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/external/python3/ubsan.patch.0 b/external/python3/ubsan.patch.0 index ab2acd3a0205..936a8ace9949 100644 --- a/external/python3/ubsan.patch.0 +++ b/external/python3/ubsan.patch.0 @@ -43,15 +43,15 @@ tramp[0] = 0xbb49; /* mov , %r11 */ - *(void* volatile*)&tramp[1] = ffi_closure_unix64; + tramp[1] = (unsigned short) ffi_closure_unix64; -+ tramp[2] = (unsigned short) (ffi_closure_unix64 >> 16); -+ tramp[3] = (unsigned short) (ffi_closure_unix64 >> 32); -+ tramp[4] = (unsigned short) (ffi_closure_unix64 >> 48); ++ tramp[2] = (unsigned short) (((unsigned long)ffi_closure_unix64) >> 16); ++ tramp[3] = (unsigned short) (((unsigned long)ffi_closure_unix64) >> 32); ++ tramp[4] = (unsigned short) (((unsigned long)ffi_closure_unix64) >> 48); tramp[5] = 0xba49; /* mov , %r10 */ - *(void* volatile*)&tramp[6] = closure; + tramp[6] = (unsigned short) closure; -+ tramp[7] = (unsigned short) (closure >> 16); -+ tramp[8] = (unsigned short) (closure >> 32); -+ tramp[9] = (unsigned short) (closure >> 48); ++ tramp[7] = (unsigned short) (((unsigned long)closure) >> 16); ++ tramp[8] = (unsigned short) (((unsigned long)closure) >> 32); ++ tramp[9] = (unsigned short) (((unsigned long)closure) >> 48); /* Set the carry bit if the function uses any sse registers. This is clc or stc, together with the first byte of the jmp. */