qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit 232b0356eb98950a08605b311087d07305e81115
parent 217f216e7204bb0be719c2a7ddd49ad9478770fe
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Fri,  6 Nov 2015 14:44:07 -0500

maybe fix small return bug in stmt()

Diffstat:
Mminic/minic.y | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/minic/minic.y b/minic/minic.y @@ -500,7 +500,7 @@ bool(Node *n, int lt, int lf) int stmt(Stmt *s, int b) { - int l; + int l, r; Symb x; if (!s) @@ -528,14 +528,14 @@ stmt(Stmt *s, int b) lbl += 3; bool(s->p1, l, l+1); fprintf(of, "@l%d\n", l); - if (!stmt(s->p2, b)) + if (!(r=stmt(s->p2, b))) if (s->p3) fprintf(of, "\tjmp @l%d\n", l+2); fprintf(of, "@l%d\n", l+1); if (s->p3) - if (!stmt(s->p3, b)) + if (!(r &= stmt(s->p3, b))) fprintf(of, "@l%d\n", l+2); - return 0; + return r; case While: l = lbl; lbl += 3;