From 5c57445f0852510702b7807fa625d57eedd0c5cb Mon Sep 17 00:00:00 2001 From: John Clarke Date: Sat, 17 Feb 2018 18:53:06 -0500 Subject: [PATCH] tcg: Fix highwater check A simple typo in the variable to use when comparing vs the highwater mark. Reports are that qemu can in fact segfault occasionally due to this mistake. Backports commit 644da9b39e477caa80bab69d2847dfcb468f0d33 from qemu --- qemu/tcg/tcg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu/tcg/tcg.c b/qemu/tcg/tcg.c index 6e643a11..da81ddae 100644 --- a/qemu/tcg/tcg.c +++ b/qemu/tcg/tcg.c @@ -2488,7 +2488,7 @@ int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf) one operation beginning below the high water mark cannot overrun the buffer completely. Thus we can test for overflow after generating code without having to check during generation. */ - if (unlikely(s->code_gen_ptr > s->code_gen_highwater)) { + if (unlikely((void *)s->code_ptr > s->code_gen_highwater)) { return -1; } }