aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tccgen.c b/tccgen.c
index be5a8cb..27ea83f 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -4979,7 +4979,9 @@ static void expr_cond(void)
expr_lor();
if (tok == '?') {
next();
- if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST) {
+ if ((vtop->r & (VT_VALMASK | VT_LVAL)) == VT_CONST &&
+ (!(vtop->r & VT_SYM) ||
+ !(vtop->sym->type.t & VT_WEAK))) {
int saved_nocode_wanted = nocode_wanted;
CType boolean;
int c;