Fix the undefined lshift negative numbers

This commit is contained in:
lazymio 2022-02-12 17:47:57 +01:00
parent a2f18bbfaf
commit d0de673208
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873
2 changed files with 3 additions and 3 deletions

View File

@ -1035,7 +1035,7 @@ static uc_err uc_gen_tb(struct uc_struct *uc, uint64_t addr, uc_tb *out_tb)
tb = cpu->tb_jmp_cache[hash];
cflags &= ~CF_CLUSTER_MASK;
cflags |= cpu->cluster_index << CF_CLUSTER_SHIFT;
cflags |= ((uint32_t)cpu->cluster_index) << CF_CLUSTER_SHIFT;
if (unlikely(!(tb &&
tb->pc == pc &&
@ -1581,7 +1581,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
}
cflags &= ~CF_CLUSTER_MASK;
cflags |= cpu->cluster_index << CF_CLUSTER_SHIFT;
cflags |= ((uint32_t)cpu->cluster_index) << CF_CLUSTER_SHIFT;
max_insns = cflags & CF_COUNT_MASK;
if (max_insns == 0) {

View File

@ -30,7 +30,7 @@ tb_lookup__cpu_state(CPUState *cpu, target_ulong *pc, target_ulong *cs_base,
tb = cpu->tb_jmp_cache[hash];
cf_mask &= ~CF_CLUSTER_MASK;
cf_mask |= cpu->cluster_index << CF_CLUSTER_SHIFT;
cf_mask |= ((uint32_t)cpu->cluster_index) << CF_CLUSTER_SHIFT;
if (likely(tb &&
tb->pc == *pc &&