aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-reflect-call.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/go-reflect-call.c')
-rw-r--r--libgo/runtime/go-reflect-call.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/libgo/runtime/go-reflect-call.c b/libgo/runtime/go-reflect-call.c
index dfc703e..29e814a 100644
--- a/libgo/runtime/go-reflect-call.c
+++ b/libgo/runtime/go-reflect-call.c
@@ -12,11 +12,10 @@
#include "go-alloc.h"
#include "go-assert.h"
#include "go-type.h"
-
-#ifdef USE_LIBFFI
-
#include "go-ffi.h"
+#if defined(USE_LIBFFI) && FFI_GO_CLOSURES
+
/* The functions in this file are only called from reflect_call. As
reflect_call calls a libffi function, which will be compiled
without -fsplit-stack, it will always run with a large stack. */
@@ -202,11 +201,7 @@ go_set_results (const struct __go_func_type *func, unsigned char *call_result,
If IS_METHOD is true this is a call to a method expression. The
first argument is the receiver. It is described in FUNC_TYPE, but
- regardless of FUNC_TYPE, it is passed as a pointer.
-
- If neither IS_INTERFACE nor IS_METHOD is true then we are calling a
- function indirectly, and we must pass a closure pointer via
- __go_set_closure. The pointer to pass is simply FUNC_VAL. */
+ regardless of FUNC_TYPE, it is passed as a pointer. */
void
reflect_call (const struct __go_func_type *func_type, FuncVal *func_val,
@@ -221,9 +216,7 @@ reflect_call (const struct __go_func_type *func_type, FuncVal *func_val,
call_result = (unsigned char *) malloc (go_results_size (func_type));
- if (!is_interface && !is_method)
- __go_set_closure (func_val);
- ffi_call (&cif, func_val->fn, call_result, params);
+ ffi_call_go (&cif, func_val->fn, call_result, params, func_val);
/* Some day we may need to free result values if RESULTS is
NULL. */