Skip to content

Commit

Permalink
Allow casting from CArrays
Browse files Browse the repository at this point in the history
  • Loading branch information
raydiak committed Jan 31, 2015
1 parent 172048c commit e53d2cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/nativecall.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,11 @@ MVMObject * MVM_nativecall_cast(MVMThreadContext *tc, MVMObject *target_spec, MV
data_body = unmarshal_cstruct(tc, source);
} else if (REPR(source)->ID == MVM_REPR_ID_MVMCPointer) {
data_body = unmarshal_cpointer(tc, source);
} else if (REPR(source)->ID == MVM_REPR_ID_MVMCArray) {
data_body = unmarshal_carray(tc, source);
} else {
MVM_exception_throw_adhoc(tc,
"Native call expected return type with CPointer or CStruct representation, but got a %s", REPR(source)->name);
"Native call expected return type with CPointer, CStruct, or CArray representation, but got a %s", REPR(source)->name);
}
return nativecall_cast(tc, target_spec, target_type, data_body);
}
Expand Down

0 comments on commit e53d2cc

Please sign in to comment.