diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-07-13 23:00:21 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-07-13 23:00:21 -0700 |
commit | c404674e20e2d274cc96a5f15c5c554e6b3a69ae (patch) | |
tree | 0d3228e22e0872bc58e7f4dca330723ac0ab6938 | |
parent | d430251a67d65d29720fe43244ef15ee04f2742e (diff) | |
download | txr-c404674e20e2d274cc96a5f15c5c554e6b3a69ae.tar.gz txr-c404674e20e2d274cc96a5f15c5c554e6b3a69ae.tar.bz2 txr-c404674e20e2d274cc96a5f15c5c554e6b3a69ae.zip |
cptr: bugfix: cptr-out must fall back on tft->put.
* ffi.c (cptr_out): tft->out may be null, in which case
tft->put must be used.
-rw-r--r-- | ffi.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -5974,7 +5974,10 @@ static val cptr_out(val cptr, val obj, val type_in) val type = default_arg(type_in, ffi_type_lookup_checked(self, cptr->co.cls)); struct txr_ffi_type *tft = ffi_type_struct_checked(self, type); if (data != 0) { - tft->out(tft, 0, obj, data, self); + if (tft->out != 0) + tft->out(tft, 0, obj, data, self); + else + tft->put(tft, obj, data, self); return obj; } uw_throwf(type_error_s, lit("~a: ~s is a null pointer"), self, cptr, nao); |