summaryrefslogtreecommitdiffstats
path: root/llgo/third_party/gofrontend/libgo/runtime/go-reflect-call.c
diff options
context:
space:
mode:
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/runtime/go-reflect-call.c')
-rw-r--r--llgo/third_party/gofrontend/libgo/runtime/go-reflect-call.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/llgo/third_party/gofrontend/libgo/runtime/go-reflect-call.c b/llgo/third_party/gofrontend/libgo/runtime/go-reflect-call.c
index 29e814a793f..2a14d6c6add 100644
--- a/llgo/third_party/gofrontend/libgo/runtime/go-reflect-call.c
+++ b/llgo/third_party/gofrontend/libgo/runtime/go-reflect-call.c
@@ -81,6 +81,12 @@ go_results_size (const struct __go_func_type *func)
off = (off + maxalign - 1) & ~ (maxalign - 1);
+ // The libffi library doesn't understand a struct with no fields.
+ // We generate a struct with a single field of type void. When used
+ // as a return value, libffi will think that requires a byte.
+ if (off == 0)
+ off = 1;
+
return off;
}
OpenPOWER on IntegriCloud