Skip to contentSkip to conversation

target-m68k: fix get_mac_extf helper

PATCH Applied Paolo Bonzini 2 participants 2 messages Jul 15, 2016 – Jul 28, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-m68k: fix get_mac_extf helper

val is assigned twice; the second one should be combined with "|". Reported by Coverity.

---
 target-m68k/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-m68k/helper.c +1 -1
index f52d0e3..89bbe6d 100644
@@ -812,7 +812,7 @@ uint32_t HELPER(get_mac_extf)(CPUM68KState *env, uint32_t acc)
 {
     uint32_t val;
     val = env->macc[acc] & 0x00ff;
-    val = (env->macc[acc] >> 32) & 0xff00;
+    val |= (env->macc[acc] >> 32) & 0xff00;
     val |= (env->macc[acc + 1] << 16) & 0x00ff0000;
     val |= (env->macc[acc + 1] >> 16) & 0xff000000;
     return val;
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Paolo Bonzini

val is assigned twice; the second one should be combined with "|". Reported by Coverity.

Applied to -trivial, thanks!

/mjt