summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-01-18 21:01:05 -0800
committerKaz Kylheku <kaz@kylheku.com>2024-01-18 21:01:05 -0800
commitfff2a530466ef8784d8c8756a83250d67f83afa4 (patch)
tree7bc40e9072aebb99bb755c24a5215ea1ef84387f
parent30a071d1a490b49dd77db9899282ae67f0082139 (diff)
downloadtxr-fff2a530466ef8784d8c8756a83250d67f83afa4.tar.gz
txr-fff2a530466ef8784d8c8756a83250d67f83afa4.tar.bz2
txr-fff2a530466ef8784d8c8756a83250d67f83afa4.zip
mmap: bug: low length diagnosed as "zero-sized element type"
* ffi.c (mmap_wrap): Make the diagnostic depend on the actual condition that it's wording is about. If the element type is nonzero, but the length is too low for the array to have any elements, that is not strictly an error; we can let that pass.
-rw-r--r--ffi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffi.c b/ffi.c
index e6ffdbfb..1a95ea80 100644
--- a/ffi.c
+++ b/ffi.c
@@ -6906,7 +6906,7 @@ val mmap_wrap(val type, val len, val prot, val flags,
int pro = c_int(prot, self);
int flg = c_int(flags, self);
- if (ln != 0 && nelem == 0)
+ if (!tft->size)
uw_throwf(error_s, lit("~a: zero-sized element type ~s specified"),
self, type, nao);