summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2025-10-08 23:19:08 +0200
committerPhil Sutter <phil@nwl.cc>2025-10-23 22:48:50 +0200
commitaec699af2a006b1dd6580abb95910c402e306fa9 (patch)
tree5f61fdcf59cc552a5c760954cd679ccde56a7631 /src
parentb30ad0c25b7b4a289dd73e8da6fa101b66fbf0d7 (diff)
datatype: Fix boolean type on Big Endian
Pass a reference to a variable with correct size when creating the expression, otherwise mpz_import_data() will read only the always zero upper byte on Big Endian hosts. Fixes: afb6a8e66a111 ("datatype: clamp boolean value to 0 and 1") Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'src')
-rw-r--r--src/datatype.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/datatype.c b/src/datatype.c
index 956ce2ac..7effeb33 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -1559,7 +1559,7 @@ static struct error_record *boolean_type_parse(struct parse_ctx *ctx,
struct expr **res)
{
struct error_record *erec;
- int num;
+ uint8_t num;
erec = integer_type_parse(ctx, sym, res);
if (erec)