diff options
Diffstat (limited to 'ext/ffi_c/Call.c')
-rw-r--r-- | ext/ffi_c/Call.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/ffi_c/Call.c b/ext/ffi_c/Call.c index bd6c277..8aa8696 100644 --- a/ext/ffi_c/Call.c +++ b/ext/ffi_c/Call.c @@ -424,7 +424,9 @@ getPointer(VALUE value, int type) } else if (type == T_DATA && rb_obj_is_kind_of(value, rbffi_StructClass)) { - AbstractMemory* memory = ((Struct *) DATA_PTR(value))->pointer; + Struct* s; + TypedData_Get_Struct(value, Struct, &rbffi_struct_data_type, s); + AbstractMemory* memory = s->pointer; return memory != NULL ? memory->address : NULL; } else if (type == T_STRING) { |