From 3b7100b703d94ef465f069c1d8befecd42cfc0fe Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 28 Apr 2017 22:53:20 -0700 Subject: 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. --- ffi.c | 1 + 1 file changed, 1 insertion(+) 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, -- cgit v1.2.3