History

better constant handling for expr_cond

Joe Soroka committed 15 years ago

Commit cd3d1a41 parent 38756b52 files · +6 −1Browse files

Unified · Split

2 files
  1. tccgen.c +4 −1
  2. tests/tcctest.c +2 −0
tccgen.c+4−1
@@ -4036,6 +4036,10 @@ static void expr_cond(void) · 4035 unmodified lines
4036 4036
4037 if (const_wanted) {4037 if (const_wanted) {
4038 expr_lor_const();4038 expr_lor_const();
4039 } else {
4040 expr_lor();
4041 }
4042 if (const_wanted || ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST)) {
4039 if (tok == '?') {4043 if (tok == '?') {
4040 CType boolean;4044 CType boolean;
4041 int c;4045 int c;
@@ -4057,7 +4061,6 @@ static void expr_cond(void) · 15 unmodified lines
4057 vpop();4061 vpop();
4058 }4062 }
4059 } else {4063 } else {
4060 expr_lor();
4061 if (tok == '?') {4064 if (tok == '?') {
4062 next();4065 next();
4063 if (vtop != vstack) {4066 if (vtop != vstack) {
tests/tcctest.c+2−0
@@ -2081,6 +2081,8 @@ void *bounds_checking_is_enabled() · 2080 unmodified lines
2081 return (ca != cp + 1) ? cp : NULL;2081 return (ca != cp + 1) ? cp : NULL;
2082}2082}
2083 2083
2084typedef int constant_negative_array_size_as_compile_time_assertion_idiom[(1 ? 2 : 0) - 1];
2085
2084void c99_vla_test(int size1, int size2)2086void c99_vla_test(int size1, int size2)
2085{2087{
2086#if defined __i386__ || defined __x86_64__2088#if defined __i386__ || defined __x86_64__

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t