diff mbox series

[for,4.1,3/4] target/mips: Add missing 'break' for certain cases of MFTR handling

Message ID 1562931470-3700-5-git-send-email-aleksandar.markovic@rt-rk.com
State New
Headers show
Series target/mips: Fixes for 4.1 | expand

Commit Message

Aleksandar Markovic July 12, 2019, 11:37 a.m. UTC
From: Aleksandar Markovic <amarkovic@wavecomp.com>

This was found by GCC 8.3 static analysis.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 target/mips/translate.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Philippe Mathieu-Daudé July 12, 2019, 1:56 p.m. UTC | #1
On 7/12/19 1:37 PM, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
> 
> This was found by GCC 8.3 static analysis.
> 

Again, please amend:

Fixes: ead9360e2fb
Reported-by: Stefan Weil <sw@weilnetz.de>

> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
> ---
>  target/mips/translate.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/target/mips/translate.c b/target/mips/translate.c
> index 59d4acd..b1cf5f0 100644
> --- a/target/mips/translate.c
> +++ b/target/mips/translate.c
> @@ -9826,6 +9826,7 @@ static void gen_mftr(CPUMIPSState *env, DisasContext *ctx, int rt, int rd,
>                  gen_mfc0(ctx, t0, rt, sel);
>                  break;
>              }
> +            break;
>          case 12:
>              switch (sel) {
>              case 0:
> @@ -9835,6 +9836,7 @@ static void gen_mftr(CPUMIPSState *env, DisasContext *ctx, int rt, int rd,
>                  gen_mfc0(ctx, t0, rt, sel);
>                  break;
>              }
> +            break;
>          case 13:
>              switch (sel) {
>              case 0:
> 

12 years missing...

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Aleksandar Markovic July 12, 2019, 2:15 p.m. UTC | #2
> From: Philippe Mathieu-Daudé <philmd@redhat.com>

> > From: Aleksandar Markovic <amarkovic@wavecomp.com>
> > 
> > This was found by GCC 8.3 static analysis.
> >

> Again, please amend:

> Fixes: ead9360e2fb

Who would think that this bug existed since 2007? ...étrange.

Thanks,
Aleksandar
diff mbox series

Patch

diff --git a/target/mips/translate.c b/target/mips/translate.c
index 59d4acd..b1cf5f0 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -9826,6 +9826,7 @@  static void gen_mftr(CPUMIPSState *env, DisasContext *ctx, int rt, int rd,
                 gen_mfc0(ctx, t0, rt, sel);
                 break;
             }
+            break;
         case 12:
             switch (sel) {
             case 0:
@@ -9835,6 +9836,7 @@  static void gen_mftr(CPUMIPSState *env, DisasContext *ctx, int rt, int rd,
                 gen_mfc0(ctx, t0, rt, sel);
                 break;
             }
+            break;
         case 13:
             switch (sel) {
             case 0: