Generate a TB at least to make sure cahce is not cleared for ADD and DEC

This commit is contained in:
lazymio 2022-04-26 01:17:07 +02:00
parent d3f1ec1345
commit ed90e98d81
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873

View File

@ -693,7 +693,13 @@ static void test_x86_clear_tb_cache(void)
static void test_x86_clear_count_cache(void)
{
uc_engine *uc;
char code[] = "\x83\xc1\x01\x4a"; // ADD ecx, 1; DEC edx;
// uc_emu_start will clear last TB when exiting so generating a tb at last
// by design
char code[] =
"\x83\xc1\x01\x4a\xeb\x00\x83\xc3\x01"; // ADD ecx, 1; DEC edx;
// jmp t;
// t:
// ADD ebx, 1
int r_ecx = 0x1234;
int r_edx = 0x7890;