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
1614 if (op != TOK_EQ) {1614 if (op != TOK_EQ) {
1615 /* generate non equal test */1615 /* generate non equal test */
1616 /* XXX: NOT PORTABLE yet */1616 /* XXX: NOT PORTABLE yet */
1617 if (a == 0) {1617 if (op1 == TOK_NE) {
1618 b = gvtst(0, 0);1618 b = gvtst(0, 0);
1619 } else {1619 } else {
1620#if defined(TCC_TARGET_I386)1620#if defined(TCC_TARGET_I386)
@@ -1622,10 +1622,8 @@ static void gen_opl(int op) · 1 unmodified line
1622#elif defined(TCC_TARGET_ARM)1622#elif defined(TCC_TARGET_ARM)
1623 b = ind;1623 b = ind;
1624 o(0x1A000000 | encbranch(ind, 0, 1));1624 o(0x1A000000 | encbranch(ind, 0, 1));
1625#elif defined(TCC_TARGET_C67) || defined(TCC_TARGET_ARM64)
1626 tcc_error("not implemented");
1627#else1625#else
1628#error not supported1626 tcc_error("not implemented");
1629#endif1627#endif
1630 }1628 }
1631 }1629 }

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