History

Revert "better constant handling for expr_cond"

It produced wrong code with one of my test projects. This reverts commit cd3d1a45f34be3c9a358f1743bcaf8aac897992e.

grischka committed 15 years ago

Commit d7d84581 parent adc80002 files · +1 −6Browse files

Unified · Split

2 files
  1. tccgen.c +1 −4
  2. tests/tcctest.c +0 −2
tccgen.c+1−4
@@ -4040,10 +4040,6 @@ static void expr_cond(void) · 4039 unmodified lines
4040 4040
4041 if (const_wanted) {4041 if (const_wanted) {
4042 expr_lor_const();4042 expr_lor_const();
4043 } else {
4044 expr_lor();
4045 }
4046 if (const_wanted || ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST)) {
4047 if (tok == '?') {4043 if (tok == '?') {
4048 CType boolean;4044 CType boolean;
4049 int c;4045 int c;
@@ -4065,6 +4061,7 @@ static void expr_cond(void) · 15 unmodified lines
4065 vpop();4061 vpop();
4066 }4062 }
4067 } else {4063 } else {
4064 expr_lor();
4068 if (tok == '?') {4065 if (tok == '?') {
4069 next();4066 next();
4070 if (vtop != vstack) {4067 if (vtop != vstack) {
tests/tcctest.c+0−2
@@ -2083,8 +2083,6 @@ void *bounds_checking_is_enabled() · 2082 unmodified lines
2083 return (ca != cp + 1) ? cp : NULL;2083 return (ca != cp + 1) ? cp : NULL;
2084}2084}
2085 2085
2086typedef int constant_negative_array_size_as_compile_time_assertion_idiom[(1 ? 2 : 0) - 1];
2087
2088void c99_vla_test(int size1, int size2)2086void c99_vla_test(int size1, int size2)
2089{2087{
2090#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