Make cbranch0() route into cbranch1(), doesn't add STRASG node yet, need to fix
authorNick Downing <downing.nick@gmail.com>
Fri, 10 Feb 2017 10:55:14 +0000 (21:55 +1100)
committerNick Downing <downing.nick@gmail.com>
Fri, 10 Feb 2017 11:02:19 +0000 (22:02 +1100)
c04.c

diff --git a/c04.c b/c04.c
index e39dbae..00632a2 100644 (file)
--- a/c04.c
+++ b/c04.c
@@ -38,8 +38,25 @@ int incref0(t) register int t; {
  * if the tree0's value is non-zero together with the cond.
  */
 void cbranch0(t, lbl, cond) union tree *t; int lbl; int cond; {
+#if 1 /* one-pass version */
+       long outloc;
+
+ /* note: we need to put STRASG crap in */
+       regpanic = 0;
+       if (setjmp(jmpbuf)) {
+               regpanic = 10;
+               fseek(/*stdout*/temp_fp[temp_fi], outloc, 0);
+       }
+       nstack = 0;
+       panicposs = 0;
+       t = optim(t);
+       if (regpanic==0 && panicposs)
+               outloc = ftell(/*stdout*/temp_fp[temp_fi]);
+       cbranch1(t, lbl, cond, 0);
+#else
        treeout(t, 0);
        outcode("BNNN", CBRANCH, lbl, cond, line);
+#endif
 }
 
 /*
@@ -80,6 +97,7 @@ void rcexpr0(tp) register union tree *tp; {
 #endif
 }
 
+#if 0
 void treeout(tp, isstruct) register union tree *tp; int isstruct; {
        register struct nmlist *hp;
        register int nextisstruct;
@@ -158,6 +176,7 @@ void treeout(tp, isstruct) register union tree *tp; int isstruct; {
        if (nextisstruct && isstruct==0)
                outcode("BNN", STRASG, STRUCT, tp->t.strp->S.ssize);
 }
+#endif
 
 /*
  * Generate a branch0