[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH for 2.10 23/35] m68k/translate: fix incorrect
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-trivial] [PATCH for 2.10 23/35] m68k/translate: fix incorrect copy/paste |
Date: |
Mon, 24 Jul 2017 20:54:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
Le 24/07/2017 à 20:27, Philippe Mathieu-Daudé a écrit :
> db3d7945ae extended gen_cc_cond() for cond [6, 7, 9, 10] but misswrote [4, 5]
>
> target/m68k/translate.c:1323:70: warning: identical expressions on both sides
> of logical operator
> if (op == CC_OP_ADDB || op == CC_OP_ADDW || op == CC_OP_ADDL ||
> op == CC_OP_ADDB || op == CC_OP_ADDW || op == CC_OP_ADDL) {
> ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~ ^
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> target/m68k/translate.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/target/m68k/translate.c b/target/m68k/translate.c
> index ada2a91b64..1a2f421aab 100644
> --- a/target/m68k/translate.c
> +++ b/target/m68k/translate.c
> @@ -1321,7 +1321,8 @@ static void gen_cc_cond(DisasCompare *c, DisasContext
> *s, int cond)
> case 5: /* CS (C) */
> /* Some cases fold C into X. */
> if (op == CC_OP_ADDB || op == CC_OP_ADDW || op == CC_OP_ADDL ||
> - op == CC_OP_ADDB || op == CC_OP_ADDW || op == CC_OP_ADDL) {
> + op == CC_OP_SUBB || op == CC_OP_SUBW || op == CC_OP_SUBL ||
> + op == CC_OP_LOGIC) {
According to commit (db3d7945) introducing the incorrect copy/paste, I
don't think we need the CC_OP_LOGIC here. Logic operations never
generates X flags (whereas they can generate Z and and N).
Thanks,
Laurent
- Re: [Qemu-trivial] [PATCH for 2.10 14/35] vfio/ccw: fix incorrect malloc() size, (continued)
- [Qemu-trivial] [PATCH for 2.10 15/35] usb: correctly handle Zero Length Packets, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-trivial] [PATCH for 2.10 19/35] usb/dev-mtp: fix use of uninitialized variable, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-trivial] [PATCH for 2.10 20/35] arm/boot: fix undefined instruction on secondary smp cpu bootloader, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-trivial] [PATCH for 2.10 22/35] arm/vexpress: fix potential memory leak, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-trivial] [PATCH for 2.10 23/35] m68k/translate: fix incorrect copy/paste, Philippe Mathieu-Daudé, 2017/07/24
- Re: [Qemu-trivial] [PATCH for 2.10 23/35] m68k/translate: fix incorrect copy/paste,
Laurent Vivier <=
[Qemu-trivial] [PATCH for 2.10 24/35] linux-user/sh4: fix incorrect memory write, Philippe Mathieu-Daudé, 2017/07/24
[Qemu-trivial] [PATCH for 2.10 25/35] linux-user: extract is_error() out of syscall.c, Philippe Mathieu-Daudé, 2017/07/24
[Qemu-trivial] [PATCH for 2.10 27/35] syscall: fix dereference of undefined pointer, Philippe Mathieu-Daudé, 2017/07/24