mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-28 12:10:05 +08:00
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;
This commit is contained in:
parent
417a1ed384
commit
ec6a997f80
6
tccgen.c
6
tccgen.c
@ -1614,7 +1614,7 @@ static void gen_opl(int op)
|
|||||||
if (op != TOK_EQ) {
|
if (op != TOK_EQ) {
|
||||||
/* generate non equal test */
|
/* generate non equal test */
|
||||||
/* XXX: NOT PORTABLE yet */
|
/* XXX: NOT PORTABLE yet */
|
||||||
if (a == 0) {
|
if (op1 == TOK_NE) {
|
||||||
b = gvtst(0, 0);
|
b = gvtst(0, 0);
|
||||||
} else {
|
} else {
|
||||||
#if defined(TCC_TARGET_I386)
|
#if defined(TCC_TARGET_I386)
|
||||||
@ -1622,10 +1622,8 @@ static void gen_opl(int op)
|
|||||||
#elif defined(TCC_TARGET_ARM)
|
#elif defined(TCC_TARGET_ARM)
|
||||||
b = ind;
|
b = ind;
|
||||||
o(0x1A000000 | encbranch(ind, 0, 1));
|
o(0x1A000000 | encbranch(ind, 0, 1));
|
||||||
#elif defined(TCC_TARGET_C67) || defined(TCC_TARGET_ARM64)
|
|
||||||
tcc_error("not implemented");
|
|
||||||
#else
|
#else
|
||||||
#error not supported
|
tcc_error("not implemented");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user