Skip to contentSkip to conversation

target-i386: fix Coverity complaints about overflows

PATCH New Paolo Bonzini 1 participant 1 message Nov 12, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-i386: fix Coverity complaints about overflows

sipi_vector is an int; it is shifted by 12 and passed as a 64-bit value, which makes Coverity think that we wanted (uint64_t)sipi_vector << 12.

But actually it must be between 0 and 255. Make this explicit.

---
 target-i386/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/cpu.h +1 -1
index 1b2c12a..015f5b5 100644
@@ -1104,7 +1104,7 @@ static inline void cpu_x86_load_seg_cache(CPUX86State *env,
 }
 
 static inline void cpu_x86_load_seg_cache_sipi(X86CPU *cpu,
-                                               int sipi_vector)
+                                               uint8_t sipi_vector)
 {
     CPUState *cs = CPU(cpu);
     CPUX86State *env = &cpu->env;
Signature · 1 line
2.1.0