summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-04-28 22:53:20 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-04-28 22:53:20 -0700
commitd2ae9d8070d38221ee323b6679152bbbc4d7acd7 (patch)
treec39b7de60b8047b5a2d944edc16d077638891038
parent83567797abfc42bc8d3ecc2a7ab1f250f1e6b93e (diff)
downloadtxr-d2ae9d8070d38221ee323b6679152bbbc4d7acd7.tar.gz
txr-d2ae9d8070d38221ee323b6679152bbbc4d7acd7.tar.bz2
txr-d2ae9d8070d38221ee323b6679152bbbc4d7acd7.zip
ffi: bugfix: ptr-in doesn't write pointer.
* ffi.c (ffi_ptr_in_put): We must write the allocated buffer's pointer to the destination memory location, otherwise nothing is passed, but garbage.
-rw-r--r--ffi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ffi.c b/ffi.c
index 9bf83ffc..aa55a39e 100644
--- a/ffi.c
+++ b/ffi.c
@@ -673,6 +673,7 @@ static void ffi_ptr_in_put(struct txr_ffi_type *tft, val s, mem_t *dst,
mem_t *buf = tgtft->alloc(tgtft, s, self);
tgtft->put(tgtft, s, buf, rtvec, self);
rtvec[tft->rtidx] = buf;
+ *coerce(mem_t **, dst) = buf;
}
static void ffi_ptr_out_in(struct txr_ffi_type *tft, val obj,