diff options
| author | seyko <seyko2@gmail.com> | 2015-03-26 07:47:45 +0300 |
|---|---|---|
| committer | seyko <seyko2@gmail.com> | 2015-03-26 07:47:45 +0300 |
| commit | acef4ff244bb3b7af596d657e2f549e33c1daf43 (patch) | |
| tree | 24d07535910d7479d26da01bf7bb7afcb4378e79 /i386-gen.c | |
| parent | 548a55eda53a0dcf2eabd617115c4e46330d7e23 (diff) | |
| download | tinycc-acef4ff244bb3b7af596d657e2f549e33c1daf43.tar.gz tinycc-acef4ff244bb3b7af596d657e2f549e33c1daf43.tar.bz2 | |
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
Diffstat (limited to 'i386-gen.c')
| -rw-r--r-- | i386-gen.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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; |
