mirror of
https://github.com/mirror/tinycc.git
synced 2025-02-06 06:40:07 +08:00
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.
This commit is contained in:
parent
339f961c11
commit
b2f5ee9b2d
2
tccgen.c
2
tccgen.c
@ -4038,7 +4038,7 @@ static void expr_cond(void)
|
|||||||
SValue sv;
|
SValue sv;
|
||||||
CType type, type1, type2;
|
CType type, type1, type2;
|
||||||
|
|
||||||
if (const_wanted) {
|
if (const_wanted || (cur_text_section == NULL)) {
|
||||||
expr_lor_const();
|
expr_lor_const();
|
||||||
if (tok == '?') {
|
if (tok == '?') {
|
||||||
CType boolean;
|
CType boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user