From fe632c4df80cb043aacacde2f78ff55d2e8b5434 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 4 Mar 2018 23:44:11 -0500 Subject: [PATCH] tcg: Fix types in tcg_regset_{set,reset}_reg There was a potential problem here with an ILP32 host with 64 host registers. Backports commit 80a8b9a910e14d4a1937f70dce944891990f3441 from qemu --- qemu/tcg/tcg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu/tcg/tcg.h b/qemu/tcg/tcg.h index 4fb90cf2..391a5b5e 100644 --- a/qemu/tcg/tcg.h +++ b/qemu/tcg/tcg.h @@ -189,9 +189,9 @@ typedef enum TCGOpcode { NB_OPS, } TCGOpcode; -#define tcg_regset_set_reg(d, r) (d) |= 1L << (r) -#define tcg_regset_reset_reg(d, r) (d) &= ~(1L << (r)) -#define tcg_regset_test_reg(d, r) (((d) >> (r)) & 1) +#define tcg_regset_set_reg(d, r) ((d) |= (TCGRegSet)1 << (r)) +#define tcg_regset_reset_reg(d, r) ((d) &= ~((TCGRegSet)1 << (r))) +#define tcg_regset_test_reg(d, r) (((d) >> (r)) & 1) #ifndef TCG_TARGET_INSN_UNIT_SIZE # error "Missing TCG_TARGET_INSN_UNIT_SIZE"