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>
This commit is contained in:
Phil Sutter 2025-10-08 23:19:08 +02:00
parent b30ad0c25b
commit aec699af2a

View File

@ -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)