Skip to content

Commit

Permalink
Add a suspicious reinterpret cast needed on Copy_Struct_Val
Browse files Browse the repository at this point in the history
  • Loading branch information
hostilefork committed Jul 7, 2015
1 parent 9605232 commit 11f0db3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/t-routine.c
Expand Up @@ -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));
Expand Down

0 comments on commit 11f0db3

Please sign in to comment.