summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-03-21 11:52:38 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-03-21 11:52:38 -0700
commit9dffe9d92c48101940c2f5e6a7efbac3409af888 (patch)
treef846a6ec4b65fa010ab036a77970ee1798b4f33f
parent9d29d3149780e97937a66ecc8dcd5c5c29d41688 (diff)
downloadtxr-9dffe9d92c48101940c2f5e6a7efbac3409af888.tar.gz
txr-9dffe9d92c48101940c2f5e6a7efbac3409af888.tar.bz2
txr-9dffe9d92c48101940c2f5e6a7efbac3409af888.zip
ffi: fix missing support for misaligned ushort.
* ffi.c (ffi_ushort_get): Add the missing align_sw_get macro that checks for and handles misalignment. Commit ab718fe8445923d9d2305034a60ae4ff0c0b9ee9 made on 2017-06-05 added these macros and fixes to numerous functions. The commit message claims that ffi_ushort_get was among the functions fixed, but no change was made to the function.
-rw-r--r--ffi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ffi.c b/ffi.c
index 2c39ad86..a83eea09 100644
--- a/ffi.c
+++ b/ffi.c
@@ -739,10 +739,12 @@ static void ffi_ushort_put(struct txr_ffi_type *tft, val n, mem_t *dst,
static val ffi_ushort_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ align_sw_get(unsigned short, src);
unsigned short n = *coerce(unsigned short *, src);
(void) tft;
(void) self;
return num_fast(n);
+ align_sw_end;
}
static void ffi_int_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)