Skip to content

Commit b06b5da

Browse files
committed
Fix further stackoverflow in tests
1 parent 94cdd73 commit b06b5da

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/unit/test_x86.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ static void test_x86_smc_add(void)
632632
{
633633
uc_engine *uc;
634634
uint64_t stack_base = 0x20000;
635-
int r_rsp;
635+
uint64_t r_rsp;
636636
/*
637637
* mov qword ptr [rip+0x10], rax
638638
* mov word ptr [rip], 0x0548
@@ -647,6 +647,8 @@ static void test_x86_smc_add(void)
647647
r_rsp = stack_base + 0x1800;
648648
OK(uc_reg_write(uc, UC_X86_REG_RSP, &r_rsp));
649649
OK(uc_emu_start(uc, code_start, -1, 0, 0));
650+
651+
OK(uc_close(uc));
650652
}
651653

652654
static void test_x86_smc_mem_hook_callback(uc_engine *uc, uc_mem_type t,
@@ -667,7 +669,7 @@ static void test_x86_smc_mem_hook(void)
667669
uc_engine *uc;
668670
uc_hook hook;
669671
uint64_t stack_base = 0x20000;
670-
int r_rsp;
672+
uint64_t r_rsp;
671673
unsigned int i = 0;
672674
/*
673675
* mov qword ptr [rip+0x29], rax
@@ -689,6 +691,8 @@ static void test_x86_smc_mem_hook(void)
689691
r_rsp = stack_base + 0x1800;
690692
OK(uc_reg_write(uc, UC_X86_REG_RSP, &r_rsp));
691693
OK(uc_emu_start(uc, code_start, -1, 0, 0));
694+
695+
OK(uc_close(uc));
692696
}
693697

694698
static uint64_t test_x86_mmio_uc_mem_rw_read_callback(uc_engine *uc,

0 commit comments

Comments
 (0)