mirror of
git://c9x.me/qbe.git
synced 2026-04-05 18:09:47 +00:00
maybe fix small return bug in stmt()
This commit is contained in:
parent
217f216e72
commit
232b0356eb
@ -500,7 +500,7 @@ bool(Node *n, int lt, int lf)
|
|||||||
int
|
int
|
||||||
stmt(Stmt *s, int b)
|
stmt(Stmt *s, int b)
|
||||||
{
|
{
|
||||||
int l;
|
int l, r;
|
||||||
Symb x;
|
Symb x;
|
||||||
|
|
||||||
if (!s)
|
if (!s)
|
||||||
@ -528,14 +528,14 @@ stmt(Stmt *s, int b)
|
|||||||
lbl += 3;
|
lbl += 3;
|
||||||
bool(s->p1, l, l+1);
|
bool(s->p1, l, l+1);
|
||||||
fprintf(of, "@l%d\n", l);
|
fprintf(of, "@l%d\n", l);
|
||||||
if (!stmt(s->p2, b))
|
if (!(r=stmt(s->p2, b)))
|
||||||
if (s->p3)
|
if (s->p3)
|
||||||
fprintf(of, "\tjmp @l%d\n", l+2);
|
fprintf(of, "\tjmp @l%d\n", l+2);
|
||||||
fprintf(of, "@l%d\n", l+1);
|
fprintf(of, "@l%d\n", l+1);
|
||||||
if (s->p3)
|
if (s->p3)
|
||||||
if (!stmt(s->p3, b))
|
if (!(r &= stmt(s->p3, b)))
|
||||||
fprintf(of, "@l%d\n", l+2);
|
fprintf(of, "@l%d\n", l+2);
|
||||||
return 0;
|
return r;
|
||||||
case While:
|
case While:
|
||||||
l = lbl;
|
l = lbl;
|
||||||
lbl += 3;
|
lbl += 3;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user