From 7fa712e00c5221d9373e8f8fa073e9e6fa064da1 Mon Sep 17 00:00:00 2001 From: grischka Date: Sat, 19 Dec 2009 22:22:43 +0100 Subject: win32: enable bounds checker & exception handler exception handler borrowed from k1w1. Thanks. --- i386-gen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'i386-gen.c') diff --git a/i386-gen.c b/i386-gen.c index bd53303..161be93 100644 --- a/i386-gen.c +++ b/i386-gen.c @@ -87,8 +87,10 @@ const int reg_classes[NB_REGS] = { /******************************************************/ static unsigned long func_sub_sp_offset; -static unsigned long func_bound_offset; static int func_ret_sub; +#ifdef CONFIG_TCC_BCHECK +static unsigned long func_bound_offset; +#endif /* XXX: make it faster ? */ void g(int c) @@ -511,12 +513,14 @@ void gfunc_prolog(CType *func_type) func_ret_sub = 4; #endif +#ifdef CONFIG_TCC_BCHECK /* leave some room for bound checking code */ if (tcc_state->do_bounds_check) { oad(0xb8, 0); /* lbound section pointer */ oad(0xb8, 0); /* call to function */ func_bound_offset = lbounds_section->data_offset; } +#endif } /* generate function epilog */ -- cgit v1.3.1