OSDN Git Service

target/i386: Tidy hw_breakpoint_remove
authorDmitry Voronetskiy <davoronetskiy@gmail.com>
Sun, 13 Jun 2021 18:08:38 +0000 (21:08 +0300)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 13 Jul 2021 15:13:19 +0000 (08:13 -0700)
Since cpu_breakpoint and cpu_watchpoint are in a union,
the code should access only one of them.

Signed-off-by: Dmitry Voronetskiy <davoronetskiy@gmail.com>
Message-Id: <20210613180838.21349-1-davoronetskiy@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/i386/tcg/sysemu/bpt_helper.c

index 624f90b..4d96a48 100644 (file)
@@ -109,9 +109,9 @@ static void hw_breakpoint_remove(CPUX86State *env, int index)
 
     case DR7_TYPE_DATA_WR:
     case DR7_TYPE_DATA_RW:
-        if (env->cpu_breakpoint[index]) {
+        if (env->cpu_watchpoint[index]) {
             cpu_watchpoint_remove_by_ref(cs, env->cpu_watchpoint[index]);
-            env->cpu_breakpoint[index] = NULL;
+            env->cpu_watchpoint[index] = NULL;
         }
         break;