History

tccgen: yet another nocode_wanted fix

Some code in gen_opl was depending on a gvtst label which in nocode_wanted mode is not set. This was causing vstack leaks and crashes with for example long long ll; if (0) return ll - 10 < 0;

grischka committed 9 years ago

Commit ec6a9971 parent 417a1ed1 file · +2 −4Browse files

Unified · Split

tccgen.c+2−4
@@ -1614,7 +1614,7 @@ static void gen_opl(int op) · 1613 unmodified lines
16141614 if (op != TOK_EQ) {
16151615 /* generate non equal test */
16161616 /* XXX: NOT PORTABLE yet */
1617− if (a == 0) {
1617+ if (op1 == TOK_NE) {
16181618 b = gvtst(0, 0);
16191619 } else {
16201620 #if defined(TCC_TARGET_I386)
@@ -1622,10 +1622,8 @@ static void gen_opl(int op) · 1 unmodified line
16221622 #elif defined(TCC_TARGET_ARM)
16231623 b = ind;
16241624 o(0x1A000000 | encbranch(ind, 0, 1));
1625−#elif defined(TCC_TARGET_C67) || defined(TCC_TARGET_ARM64)
1626− tcc_error("not implemented");
16271625 #else
1628−#error not supported
1626+ tcc_error("not implemented");
16291627 #endif
16301628 }
16311629 }

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