[PATCH v3 10/26] target/m68k: Use g_assert_not_reached in gen_lea_mode and gen_ea_mode

Richard Henderson posted 26 patches 2 months, 2 weeks ago
[PATCH v3 10/26] target/m68k: Use g_assert_not_reached in gen_lea_mode and gen_ea_mode
Posted by Richard Henderson 2 months, 2 weeks ago
The mode argument is extracted from 3 bits, and all cases are covered.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/m68k/translate.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 1ba1220b21..71dfa6d9a2 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -767,8 +767,7 @@ static TCGv gen_lea_mode(CPUM68KState *env, DisasContext *s,
         tcg_gen_movi_i32(tmp, offset);
         return tmp;
     }
-    /* Should never happen.  */
-    return NULL_QREG;
+    g_assert_not_reached();
 }
 
 static TCGv gen_lea(CPUM68KState *env, DisasContext *s, uint16_t insn,
@@ -892,8 +891,7 @@ static TCGv gen_ea_mode(CPUM68KState *env, DisasContext *s, int mode, int reg0,
             return NULL_QREG;
         }
     }
-    /* Should never happen.  */
-    return NULL_QREG;
+    g_assert_not_reached();
 }
 
 static TCGv_ptr gen_fp_ptr(int freg)
-- 
2.43.0
Re: [PATCH v3 10/26] target/m68k: Use g_assert_not_reached in gen_lea_mode and gen_ea_mode
Posted by Philippe Mathieu-Daudé 2 months, 2 weeks ago
On 9/9/24 19:28, Richard Henderson wrote:
> The mode argument is extracted from 3 bits, and all cases are covered.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/m68k/translate.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>