diff mbox

target-m68k: fix get_mac_extf helper

Message ID 1468596562-28609-1-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini July 15, 2016, 3:29 p.m. UTC
val is assigned twice; the second one should be combined with "|".
Reported by Coverity.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target-m68k/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Tokarev July 28, 2016, 3:31 p.m. UTC | #1
15.07.2016 18:29, Paolo Bonzini wrote:
> val is assigned twice; the second one should be combined with "|".
> Reported by Coverity.

Applied to -trivial, thanks!

/mjt
diff mbox

Patch

diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index f52d0e3..89bbe6d 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -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;