The management of env->current_tb is quite complicated. In particular, a while loop that has it as a test condition is actually executed just once, and it is cleared long after it has ceased being meaningful.
This patch set straightens things a bit. Patch 1 clears env->current_tb when it is not meaningful anymore. Patch 2 adds assertions that test the change done in patch 3. These are then removed in patch 4. I preferred to be defensive, but I'd understand squashing the three patches together as well. Paolo Bonzini (4): clean up env->current_tb add assertions about env->current_tb change while to if remove assertions cpu-exec.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-)