Bug fix for commit 553242c18a
.
In gtst, vtop->c.i is not usually zero, but it is when compiling: int f(void) { return 1 && 1 ? 1 : 1; }
This commit is contained in:
parent
8dd1859176
commit
4ae626451e
2 changed files with 14 additions and 10 deletions
|
@ -678,12 +678,14 @@ ST_FUNC int gtst(int inv, int t)
|
||||||
} else if (v == VT_JMP || v == VT_JMPI) {
|
} else if (v == VT_JMP || v == VT_JMPI) {
|
||||||
/* && or || optimization */
|
/* && or || optimization */
|
||||||
if ((v & 1) == inv) {
|
if ((v & 1) == inv) {
|
||||||
uint32_t n1, n = vtop->c.i;
|
|
||||||
/* insert vtop->c jump list in t */
|
/* insert vtop->c jump list in t */
|
||||||
|
uint32_t n1, n = vtop->c.i;
|
||||||
|
if (n) {
|
||||||
while ((n1 = read32le(cur_text_section->data + n)))
|
while ((n1 = read32le(cur_text_section->data + n)))
|
||||||
n = n1;
|
n = n1;
|
||||||
write32le(cur_text_section->data + n, t);
|
write32le(cur_text_section->data + n, t);
|
||||||
t = vtop->c.i;
|
t = vtop->c.i;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
t = gjmp(t);
|
t = gjmp(t);
|
||||||
gsym(vtop->c.i);
|
gsym(vtop->c.i);
|
||||||
|
|
|
@ -1716,12 +1716,14 @@ int gtst(int inv, int t)
|
||||||
} else if (v == VT_JMP || v == VT_JMPI) {
|
} else if (v == VT_JMP || v == VT_JMPI) {
|
||||||
/* && or || optimization */
|
/* && or || optimization */
|
||||||
if ((v & 1) == inv) {
|
if ((v & 1) == inv) {
|
||||||
uint32_t n1, n = vtop->c.i;
|
|
||||||
/* insert vtop->c jump list in t */
|
/* insert vtop->c jump list in t */
|
||||||
|
uint32_t n1, n = vtop->c.i;
|
||||||
|
if (n) {
|
||||||
while ((n1 = read32le(cur_text_section->data + n)))
|
while ((n1 = read32le(cur_text_section->data + n)))
|
||||||
n = n1;
|
n = n1;
|
||||||
write32le(cur_text_section->data + n, t);
|
write32le(cur_text_section->data + n, t);
|
||||||
t = vtop->c.i;
|
t = vtop->c.i;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
t = gjmp(t);
|
t = gjmp(t);
|
||||||
gsym(vtop->c.i);
|
gsym(vtop->c.i);
|
||||||
|
|
Loading…
Add table
Reference in a new issue