i386: Fix missing break; in case statement leading to incorrectly returned FFI_BAD_ABI (#437)

* 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>
This commit is contained in:
Jeremy Huddleston Sequoia
2018-06-17 17:01:50 -07:00
committed by Anthony Green
parent b55baf0b50
commit 1d704051b2
3 changed files with 43 additions and 0 deletions

View 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;
}

View 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__ */