mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-27 06:10:06 +08:00
better constant handling for expr_cond
This commit is contained in:
parent
38756b506f
commit
cd3d1a45f3
5
tccgen.c
5
tccgen.c
@ -4036,6 +4036,10 @@ static void expr_cond(void)
|
||||
|
||||
if (const_wanted) {
|
||||
expr_lor_const();
|
||||
} else {
|
||||
expr_lor();
|
||||
}
|
||||
if (const_wanted || ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST)) {
|
||||
if (tok == '?') {
|
||||
CType boolean;
|
||||
int c;
|
||||
@ -4057,7 +4061,6 @@ static void expr_cond(void)
|
||||
vpop();
|
||||
}
|
||||
} else {
|
||||
expr_lor();
|
||||
if (tok == '?') {
|
||||
next();
|
||||
if (vtop != vstack) {
|
||||
|
@ -2081,6 +2081,8 @@ void *bounds_checking_is_enabled()
|
||||
return (ca != cp + 1) ? cp : NULL;
|
||||
}
|
||||
|
||||
typedef int constant_negative_array_size_as_compile_time_assertion_idiom[(1 ? 2 : 0) - 1];
|
||||
|
||||
void c99_vla_test(int size1, int size2)
|
||||
{
|
||||
#if defined __i386__ || defined __x86_64__
|
||||
|
Loading…
Reference in New Issue
Block a user