From 57fff7a94bf0493e0407133ca3b96bd579b7fb94 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sun, 25 Feb 2018 23:20:58 -0500 Subject: [PATCH] target-m68k: fix get_mac_extf helper val is assigned twice; the second one should be combined with "|". Reported by Coverity. Backports commit 5ce747cfac697f61668ab4fa4a71c1dba15cc272 from qemu --- qemu/target-m68k/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu/target-m68k/helper.c b/qemu/target-m68k/helper.c index 2ccb2758..60ad5992 100644 --- a/qemu/target-m68k/helper.c +++ b/qemu/target-m68k/helper.c @@ -726,7 +726,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;