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
This commit is contained in:
John Clarke 2018-02-17 18:53:06 -05:00 committed by Lioncash
parent 3ba8959dfd
commit 5c57445f08
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -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;
}
}