Generate check_exit_request for the first tb

Consider this case:

   t:inc ecx,
     inc edx,
     jmp t

It would generate exactly one block and TB chain will generate an inline
jump. If we don't check exit at the entry of the block, we will never be
terminated.

This test case is recorded in the commit message since it's a bit
painful to write multithread related code that builds on all platforms.
This commit is contained in:
lazymio 2022-03-05 22:35:58 +01:00
parent b7bc13650c
commit 12fa73f2b6
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873
1 changed files with 0 additions and 7 deletions

View File

@ -36,13 +36,6 @@ static inline void gen_tb_start(TCGContext *tcg_ctx, TranslationBlock *tb)
tcg_ctx->exitreq_label = gen_new_label(tcg_ctx);
// first TB ever does not need to check exit request
if (tcg_ctx->uc->first_tb) {
// next TB is not the first anymore
tcg_ctx->uc->first_tb = false;
return;
}
count = tcg_temp_new_i32(tcg_ctx);
tcg_gen_ld_i32(tcg_ctx, count, tcg_ctx->cpu_env,