From 8da8ba5a1cc7adf3ad5a4576510aae5c31ae0a6e Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Mon, 14 Feb 2022 10:41:07 +0000 Subject: Fix various instances of implicit conversions. The implicit conversions were discovered with Clang's UBSan (with the -fsanitizer=implicit-conversion option). * gc.c (sweep_one): Convert only the inverted REACHABLE, since block->t.type is already of the right type. * hash.c (eql_hash, eq_hash, hash_iter_init, us_hash_iter_init): Explicitly convert to ucnum. * linenoise/linenoise.c (enable_raw_mode): Explicitly convert the inverted flag sets to tcflag_t. * mpi/mpi.c (mp_set_uintptr): Explicitly convert to uint_ptr_t. * regex.c (char_set_add): Explicitly convert to bitcell_t. * struct.c (struct_inst_hash): Correct type of hash from cnum to ucnum. --- mpi/mpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mpi') diff --git a/mpi/mpi.c b/mpi/mpi.c index a1541d8b..34003253 100644 --- a/mpi/mpi.c +++ b/mpi/mpi.c @@ -421,7 +421,7 @@ mp_err mp_set_uintptr(mp_int *mp, uint_ptr_t z) mp_err mp_set_intptr(mp_int *mp, int_ptr_t z) { - uint_ptr_t w = z; + uint_ptr_t w = convert(uint_ptr_t, z); uint_ptr_t v = z >= 0 ? w : -w; mp_err err = mp_set_uintptr(mp, v); -- cgit v1.2.3