disas/cris: Avoid unintended sign extension
commit001ebaca7b1120233e04c38f3e3ad3f377137c69
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 3 Mar 2017 15:50:32 +0000 (3 15:50 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 7 Mar 2017 14:33:51 +0000 (7 14:33 +0000)
treecc96ab76674cc17e5139ec3264a3041ab4d37c84
parent1d153a3388b150b8aeedde32242db86b79c45473
disas/cris: Avoid unintended sign extension

In the cris disassembler we were using 'unsigned long' to calculate
addresses which are supposed to be 32 bits.  This meant that we might
accidentally sign extend or calculate a value that was outside the 32
bit range of the guest CPU.  Use 'uint32_t' instead so we give the
right answers on 64-bit hosts.

(Spotted by Coverity, CID 10054021005403.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 1488556233-31246-6-git-send-email-peter.maydell@linaro.org
disas/cris.c