Skip to content

Commit

Permalink
Use libffi in emscripten (#53)
Browse files Browse the repository at this point in the history
As far as I (arigo) can tell, Emscripten doesn't support fork() and has got no way of supporting it in the future. So the version provided by libffi cannot come with the specific security issue that malloc_closure.h is designed to avoid.
  • Loading branch information
hoodmane authored Jan 30, 2024
1 parent 39f9987 commit 954cab4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/c/_cffi_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@
# define CFFI_CHECK_FFI_PREP_CIF_VAR __builtin_available(macos 10.15, ios 13, watchos 6, tvos 13, *)
# define CFFI_CHECK_FFI_PREP_CIF_VAR_MAYBE 1

#elif defined(__EMSCRIPTEN__)

# define CFFI_CHECK_FFI_CLOSURE_ALLOC 1
# define CFFI_CHECK_FFI_CLOSURE_ALLOC_MAYBE 1
# define CFFI_CHECK_FFI_PREP_CLOSURE_LOC 1
# define CFFI_CHECK_FFI_PREP_CLOSURE_LOC_MAYBE 1
# define CFFI_CHECK_FFI_PREP_CIF_VAR 1
# define CFFI_CHECK_FFI_PREP_CIF_VAR_MAYBE 1

#else

# define CFFI_CHECK_FFI_CLOSURE_ALLOC 0
Expand Down

0 comments on commit 954cab4

Please sign in to comment.