• Peter Maydell's avatar
    disas/arm: Avoid unintended sign extension · 43c227f9
    Peter Maydell authored
    When assembling 'given' from the instruction bytes, C's integer
    promotion rules mean we may promote an unsigned char to a signed
    integer before shifting it, and then sign extend to a 64-bit long,
    which can set the high bits of the long.  The code doesn't in fact
    care about the high bits if the long is 64 bits, but this is
    surprising, so don't do it.
    
    (Spotted by Coverity, CID 1005404.)
    Signed-off-by: 's avatarPeter Maydell <peter.maydell@linaro.org>
    Message-id: 1488556233-31246-7-git-send-email-peter.maydell@linaro.org
    43c227f9
arm.c 154 KB