win32: enable bounds checker & exception handler
exception handler borrowed from k1w1. Thanks.
This commit is contained in:
11
tcc.h
11
tcc.h
@ -101,7 +101,7 @@
|
||||
#define TCC_TARGET_I386
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32) && !defined(TCC_UCLIBC) && !defined(TCC_TARGET_ARM) && \
|
||||
#if !defined(TCC_UCLIBC) && !defined(TCC_TARGET_ARM) && \
|
||||
!defined(TCC_TARGET_C67) && !defined(TCC_TARGET_X86_64)
|
||||
#define CONFIG_TCC_BCHECK /* enable bound checking code */
|
||||
#endif
|
||||
@ -120,7 +120,7 @@
|
||||
#define TCC_TARGET_COFF
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32) && !defined(CONFIG_TCCBOOT)
|
||||
#if !defined(CONFIG_TCCBOOT)
|
||||
#define CONFIG_TCC_BACKTRACE
|
||||
#endif
|
||||
|
||||
@ -465,8 +465,10 @@ struct TCCState {
|
||||
int verbose;
|
||||
/* compile with debug symbol (and use them if error during execution) */
|
||||
int do_debug;
|
||||
#ifdef CONFIG_TCC_BCHECK
|
||||
/* compile with built-in memory and bounds checker */
|
||||
int do_bounds_check;
|
||||
#endif
|
||||
/* give the path of the tcc libraries */
|
||||
char *tcc_lib_path;
|
||||
|
||||
@ -809,11 +811,6 @@ char *pstrcat(char *buf, int buf_size, const char *s);
|
||||
void dynarray_add(void ***ptab, int *nb_ptr, void *data);
|
||||
void dynarray_reset(void *pp, int *n);
|
||||
|
||||
#ifdef CONFIG_TCC_BACKTRACE
|
||||
extern int num_callers;
|
||||
extern const char **rt_bound_error_msg;
|
||||
#endif
|
||||
|
||||
/* true if float/double/long double type */
|
||||
static inline int is_float(int t)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user