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.
Unified · Split
| @@ -4038,7 +4038,7 @@ static void expr_cond(void) · 4037 unmodified lines | ||
| 4038 | 4038 | SValue sv; |
| 4039 | 4039 | CType type, type1, type2; |
| 4040 | 4040 | |
| 4041 | − if (const_wanted) { | |
| 4041 | + if (const_wanted || (cur_text_section == NULL)) { | |
| 4042 | 4042 | expr_lor_const(); |
| 4043 | 4043 | if (tok == '?') { |
| 4044 | 4044 | CType boolean; |