Commit a2473cde0a02c096dc3e0b57f0cb73f598765570

Anthony Green 2022-09-24T21:41:02

or1k: All struct args are passed in memory

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/or1k/ffi.c b/src/or1k/ffi.c
index c8ed110..9451d4e 100644
--- a/src/or1k/ffi.c
+++ b/src/or1k/ffi.c
@@ -139,7 +139,7 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
       {
         ffi_type *at = cif->arg_types[i];
         int size = at->size;
-        if (at->type == FFI_TYPE_STRUCT && size > 4)
+        if (at->type == FFI_TYPE_STRUCT) /* && size > 4) All struct args? */
           {
             char *argcopy = alloca (size);
             memcpy (argcopy, avalue[i], size);