]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commitdiff
target-xtensa: fix search_pc for the last TB opcode
authorMax Filippov <jcmvbkbc@gmail.com>
Wed, 19 Dec 2012 20:04:09 +0000 (00:04 +0400)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 16 Jan 2013 05:04:53 +0000 (23:04 -0600)
Zero out tcg_ctx.gen_opc_instr_start for instructions representing the
last guest opcode in the TB.

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
(cherry picked from commit 36f25d2537c40c6c47f4abee5d31a24863d1adf7)

*modified to use older global version of gen_opc_instr_start

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target-xtensa/translate.c

index e5a3f49a7571ca572c4230694e58c532f16442e8..87f26c2cce04db959cf24c753229fc28d44f11ec 100644 (file)
@@ -2962,7 +2962,11 @@ static void gen_intermediate_code_internal(
     gen_icount_end(tb, insn_count);
     *tcg_ctx.gen_opc_ptr = INDEX_op_end;
 
-    if (!search_pc) {
+    if (search_pc) {
+        j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf;
+        memset(gen_opc_instr_start + lj + 1, 0,
+                (j - lj) * sizeof(gen_opc_instr_start[0]));
+    } else {
         tb->size = dc.pc - pc_start;
         tb->icount = insn_count;
     }