Force null pointer exception for code outside of a function
commitdd37b57f2c7e96ba77cc3b9b1e0679ccfc40608f
authorDaniel Glöckner <daniel-gl@gmx.net>
Thu, 11 Sep 2008 17:17:40 +0000 (11 19:17 +0200)
committerDaniel Glöckner <daniel-gl@gmx.net>
Thu, 11 Sep 2008 17:17:40 +0000 (11 19:17 +0200)
tree105d7839ab0fc4f8debe1b8179dcbdb4ded7c3a8
parent59adcd47ff82186b3ae04dd41ee6f0aac78764cb
Force null pointer exception for code outside of a function

TinyCC sometimes has problems to evaluate constant expressions at
compile time. This leads to code being generated outside of functions.
Without this patch some of these bugs are not caught, because
cur_text_section still points to the section of the last function.
Before the first function cur_text_section is uninitialized.
Setting cur_text_section to a null pointer should make TinyCC die in
all cases.
tcc.c