aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@celest.fr>2011-07-30 22:57:53 +0200
committerThomas Preud'homme <thomas.preudhomme@celest.fr>2011-07-31 00:19:13 +0200
commitb2f5ee9b2de40e26ba3d92cf3950be6da7766b7d (patch)
tree01569c465e8e0e539f1d8648ce953216b9f6801f /tccgen.c
parent339f961c115fcff68d94026b930b6840fe023eb7 (diff)
downloadtinycc-b2f5ee9b2de40e26ba3d92cf3950be6da7766b7d.tar.gz
tinycc-b2f5ee9b2de40e26ba3d92cf3950be6da7766b7d.tar.bz2
Force const. expr. in expr_cond outside function
Since no code should be generated outside a function, force expr_cond to only consider constant expression when outside a function since the generic code can generate some code.
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tccgen.c b/tccgen.c
index e488c65..9e06118 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -4038,7 +4038,7 @@ static void expr_cond(void)
SValue sv;
CType type, type1, type2;
- if (const_wanted) {
+ if (const_wanted || (cur_text_section == NULL)) {
expr_lor_const();
if (tok == '?') {
CType boolean;