diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-11-06 14:44:07 -0500 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-11-06 14:44:07 -0500 |
commit | 232b0356eb98950a08605b311087d07305e81115 (patch) | |
tree | 064e63c991b883205f90c1b9db97c1c15d0d20a1 | |
parent | 217f216e7204bb0be719c2a7ddd49ad9478770fe (diff) | |
download | roux-232b0356eb98950a08605b311087d07305e81115.tar.gz |
maybe fix small return bug in stmt()
-rw-r--r-- | minic/minic.y | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/minic/minic.y b/minic/minic.y index 1814bc3..c2af7f6 100644 --- 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; |