From b2f5ee9b2de40e26ba3d92cf3950be6da7766b7d Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Sat, 30 Jul 2011 22:57:53 +0200 Subject: [PATCH] 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. --- tccgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tccgen.c b/tccgen.c index e488c650..9e061186 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;