]> git.proxmox.com Git - mirror_qemu.git/commit
target/arm: Fix crash on conditional instruction in an IT block
authorRoman Kapl <rka@sysgo.com>
Mon, 20 Aug 2018 10:24:31 +0000 (11:24 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 20 Aug 2018 10:24:31 +0000 (11:24 +0100)
commitc2d9644e6d517170bf6520f633628259a8460d48
tree63809975e19701fa7f9ae33621009d32eb00221c
parentadaec191bfb31e12d40af8ab1b869f5b40d61ee9
target/arm: Fix crash on conditional instruction in an IT block

If an instruction is conditional (like CBZ) and it is executed
conditionally (using the ITx instruction), a jump to an undefined
label is generated, and QEMU crashes.

CBZ in IT block is an UNPREDICTABLE behavior, but we should not
crash.  Honouring the condition code is allowed by the spec in this
case (constrained unpredictable, ARMv8, section K1.1.7), and matches
what we do for other "UNPREDICTABLE inside an IT block" instructions.

Fix the 'skip on condition' code to create a new label only if it
does not already exist.  Previously multiple labels were created, but
only the last one of them was set.

Signed-off-by: Roman Kapl <rka@sysgo.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180816120533.6587-1-rka@sysgo.com
[PMM: fixed ^ 1 being applied to wrong argument, fixed typo]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/translate.c