From 11f0db38a8a9e55b37778c0cba7577173589d675 Mon Sep 17 00:00:00 2001 From: Hostile Fork Date: Mon, 6 Jul 2015 23:34:14 -0400 Subject: [PATCH] Add a suspicious reinterpret cast needed on Copy_Struct_Val --- src/core/t-routine.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/t-routine.c b/src/core/t-routine.c index f933dd2135..c784f9a5d9 100644 --- a/src/core/t-routine.c +++ b/src/core/t-routine.c @@ -677,7 +677,9 @@ static void ffi_to_rebol(REBRIN *rin, SET_DECIMAL(rebol_ret, *(double*)ffi_rvalue); break; case FFI_TYPE_STRUCT: - Copy_Struct_Val(&RIN_RVALUE(rin), rebol_ret); + // !!! &RIN_RVALUE(rin) returns a REBVAL*, but this cast is needed + // as it is being treated as if it were a REBSTU*...is that right? + Copy_Struct_Val(r_cast(REBSTU *, &RIN_RVALUE(rin)), rebol_ret); memcpy(SERIES_SKIP(VAL_STRUCT_DATA_BIN(rebol_ret), VAL_STRUCT_OFFSET(rebol_ret)), ffi_rvalue, VAL_STRUCT_LEN(rebol_ret));