From: Scott Wood Date: Tue, 19 Jun 2012 02:31:36 +0000 (-0500) Subject: tci: don't write zero for reloc in tci_out_label X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3c01ae0ea29915d165c384d0bd1cbafcf4364a4d;p=qmiga%2Fqemu.git tci: don't write zero for reloc in tci_out_label If tci_out_label is called in the context of tcg_gen_code_search_pc, we could be overwriting an already patched relocation with zero -- and not repatch it because the set_label is past search_pc, causing a QEMU crash when it tries to branch to a zero label. Not writing anything to the relocation area seems to be in line with what other backends do from the couple I looked at (x86, ppc). Signed-off-by: Scott Wood Signed-off-by: Blue Swirl --- diff --git a/tcg/tci/tcg-target.c b/tcg/tci/tcg-target.c index d0a368d99a..ef8580fc8d 100644 --- a/tcg/tci/tcg-target.c +++ b/tcg/tci/tcg-target.c @@ -487,7 +487,7 @@ static void tci_out_label(TCGContext *s, TCGArg arg) assert(label->u.value); } else { tcg_out_reloc(s, s->code_ptr, sizeof(tcg_target_ulong), arg, 0); - tcg_out_i(s, 0); + s->code_ptr += sizeof(tcg_target_ulong); } }