diff --git a/tcc.c b/tcc.c index 98d8de6c..81237a9f 100644 --- a/tcc.c +++ b/tcc.c @@ -9244,6 +9244,8 @@ static void gen_function(Sym *sym) if (do_debug) { put_stabn(N_FUN, 0, 0, ind - func_ind); } + /* It's better to crash than to generate wrong code */ + cur_text_section = NULL; funcname = ""; /* for safety */ func_vt.t = VT_VOID; /* for safety */ ind = 0; /* for safety */ @@ -9511,6 +9513,7 @@ static int tcc_compile(TCCState *s1) #endif preprocess_init(s1); + cur_text_section = NULL; funcname = ""; anon_sym = SYM_FIRST_ANOM;