summaryrefslogtreecommitdiff
path: root/src/aarch64/ffi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/aarch64/ffi.c')
-rw-r--r--src/aarch64/ffi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/aarch64/ffi.c b/src/aarch64/ffi.c
index c48c549..188acf2 100644
--- a/src/aarch64/ffi.c
+++ b/src/aarch64/ffi.c
@@ -773,6 +773,10 @@ ffi_prep_closure_loc (ffi_closure *closure,
*(UINT64 *)(tramp + 16) = (uintptr_t)start;
ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE);
+
+ /* Also flush the cache for code mapping. */
+ unsigned char *tramp_code = ffi_data_to_code_pointer (tramp);
+ ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE);
#endif
closure->cif = cif;