Skip to content

Commit

Permalink
target-xtensa: fix search_pc for the last TB opcode
Browse files Browse the repository at this point in the history
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 36f25d2)

*modified to use older global version of gen_opc_instr_start

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
jcmvbkbc authored and mdroth committed Jan 16, 2013
1 parent ff0c079 commit 1205b80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion target-xtensa/translate.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1205b80

Please sign in to comment.