i386: Fix missing break; in case statement leading to incorrectly returned FFI_BAD_AB...
authorJeremy Huddleston Sequoia <jeremyhu@users.noreply.github.com>
Mon, 18 Jun 2018 00:01:50 +0000 (17:01 -0700)
committerAnthony Green <green@moxielogic.com>
Mon, 18 Jun 2018 00:01:50 +0000 (20:01 -0400)
* i386: Add missing break triggering dead store static analyzer checks.

Register calling sequence is being reported as bad ABI instead of working as intended.

Found-by: Clang Static Analysis
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
* Mark ffi arm sysv entry points as private_extern.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
* x86_64: Add implementation of compact unwind for ffi_call_unix64.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
src/arm/sysv.S
src/x86/ffi.c
src/x86/unix64.S

index 7bda640e4ec38b4afbf2ffdf204382c14ecfb189..a40e327db87aabcb8467385b2c5c92186f2e08c5 100644 (file)
@@ -85,6 +85,7 @@
 
 #define ARM_FUNC_START(name)           \
        .globl CNAME(name);             \
+       .private_extern CNAME(name);    \
        FFI_HIDDEN(CNAME(name));        \
        ARM_FUNC_START_LOCAL(name)
 
index 021f6832a99e6263a906d0051a3669c342472f61..cad32e8a0421778478d5a5b6fa73386ae2c4af48 100644 (file)
@@ -545,6 +545,7 @@ ffi_prep_closure_loc (ffi_closure* closure,
     case FFI_REGISTER:
       dest = ffi_closure_REGISTER;
       op = 0x68;  /* pushl imm */
+      break;
     default:
       return FFI_BAD_ABI;
     }
index db792c0dd7d9dec2e251b78f444b31dbb89ea175..d3987408f7101fe004e006d2aec986d380a97a86 100644 (file)
@@ -517,6 +517,47 @@ L(SFDE5):
 L(EFDE5):
 #ifdef __APPLE__
        .subsections_via_symbols
+       .section __LD,__compact_unwind
+
+       /* compact unwind for ffi_call_unix64 */
+       .quad    C(ffi_call_unix64)
+       .set     L1,L(UW4)-L(UW0)
+       .long    L1
+       .long    0x04000000 /* use dwarf unwind info */
+       .quad    0
+       .quad    0
+
+       /* compact unwind for ffi_closure_unix64_sse */
+       .quad    C(ffi_closure_unix64_sse)
+       .set     L2,L(UW7)-L(UW5)
+       .long    L2
+       .long    0x04000000 /* use dwarf unwind info */
+       .quad    0
+       .quad    0
+
+       /* compact unwind for ffi_closure_unix64 */
+       .quad    C(ffi_closure_unix64)
+       .set     L3,L(UW11)-L(UW8)
+       .long    L3
+       .long    0x04000000 /* use dwarf unwind info */
+       .quad    0
+       .quad    0
+
+       /* compact unwind for ffi_go_closure_unix64_sse */
+       .quad    C(ffi_go_closure_unix64_sse)
+       .set     L4,L(UW14)-L(UW12)
+       .long    L4
+       .long    0x04000000 /* use dwarf unwind info */
+       .quad    0
+       .quad    0
+
+       /* compact unwind for ffi_go_closure_unix64 */
+       .quad    C(ffi_go_closure_unix64)
+       .set     L5,L(UW17)-L(UW15)
+       .long    L5
+       .long    0x04000000 /* use dwarf unwind info */
+       .quad    0
+       .quad    0
 #endif
 
 #endif /* __x86_64__ */