From acef4ff244bb3b7af596d657e2f549e33c1daf43 Mon Sep 17 00:00:00 2001 From: seyko Date: Thu, 26 Mar 2015 07:47:45 +0300 Subject: make a bound checking more compatible with Windows 64 On Linux 32: sizeof(long)=32 == sizeof(void *)=32 on Linux 64: sizeof(long)=64 == sizeof(void *)=64 on Windows 64: sizeof(long)=32 != sizeof(void *)=64 --- i386-gen.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'i386-gen.c') diff --git a/i386-gen.c b/i386-gen.c index c2db3d0..b9dec83 100644 --- a/i386-gen.c +++ b/i386-gen.c @@ -99,7 +99,7 @@ ST_DATA const int reg_classes[NB_REGS] = { static unsigned long func_sub_sp_offset; static int func_ret_sub; #ifdef CONFIG_TCC_BCHECK -static unsigned long func_bound_offset; +static addr_t func_bound_offset; #endif /* XXX: make it faster ? */ @@ -587,16 +587,16 @@ ST_FUNC void gfunc_prolog(CType *func_type) /* generate function epilog */ ST_FUNC void gfunc_epilog(void) { - int v, saved_ind; + addr_t v, saved_ind; #ifdef CONFIG_TCC_BCHECK if (tcc_state->do_bounds_check && func_bound_offset != lbounds_section->data_offset) { - int saved_ind; - int *bounds_ptr; + addr_t saved_ind; + addr_t *bounds_ptr; Sym *sym_data; /* add end of table info */ - bounds_ptr = section_ptr_add(lbounds_section, sizeof(int)); + bounds_ptr = section_ptr_add(lbounds_section, sizeof(addr_t)); *bounds_ptr = 0; /* generate bound local allocation */ saved_ind = ind; @@ -1058,8 +1058,8 @@ ST_FUNC void gen_bounded_ptr_add(void) also tested */ ST_FUNC void gen_bounded_ptr_deref(void) { - int func; - int size, align; + addr_t func; + addr_t size, align; Elf32_Rel *rel; Sym *sym; -- cgit v1.3.1