Fixed problem with missed unstacks
authorceriel <none@none>
Tue, 30 Mar 1993 09:41:00 +0000 (09:41 +0000)
committerceriel <none@none>
Tue, 30 Mar 1993 09:41:00 +0000 (09:41 +0000)
lang/cem/cemcom.ansi/arith.c
lang/cem/cemcom.ansi/code.c
lang/cem/cemcom.ansi/replace.c

index 9190c08..7d6368c 100644 (file)
@@ -31,6 +31,7 @@
 extern char *symbol2str();
 extern char options[];
 extern arith flt_flt2arith();
+extern label code_string();
 
 arithbalance(e1p, oper, e2p)   /* 3.1.2.5 */
        register struct expr **e1p, **e2p;
@@ -464,9 +465,9 @@ string2pointer(ex)
        /*      The expression, which must be a string constant, is converted
                to a pointer to the string-containing area.
        */
-       label lbl = data_label();
+       label lbl;
 
-       code_string(ex->SG_VALUE, ex->SG_LEN, lbl);
+       lbl = code_string(ex->SG_VALUE, ex->SG_LEN);
        ex->ex_class = Value;
        ex->VL_CLASS = Label;
        ex->VL_LBL = lbl;
index 03205cd..af3f973 100644 (file)
@@ -105,12 +105,13 @@ init_code(dst_file)
 
 struct string_cst *str_list = 0;
 
-code_string(val, len, dlb)
+label
+code_string(val, len)
        char *val;
        int len;
-       label dlb;
 {
        register struct string_cst *sc = new_string_cst();
+       label lbl = data_label();
 
        C_ina_dlb(dlb);
        sc->next = str_list;
@@ -118,6 +119,7 @@ code_string(val, len, dlb)
        sc->sc_value = val;
        sc->sc_len = len;
        sc->sc_dlb = dlb;
+       return dlb;
 }
 
 def_strings(sc)
index ad49b6c..8682657 100644 (file)
@@ -308,14 +308,23 @@ actual(repl)
        register int ch = 0;
        register int level = 0, nostashraw = 0;
        int lastch;
+       static int Unstacked_missed;
 
        while (1) {
                lastch = ch;
                ch = GetChar();
 
+               if (nostashraw 
+                   && nostashraw >= Unstacked_missed) {
+                       nostashraw -= Unstacked_missed;
+                       Unstacked_missed = 0;
+               }
                if (Unstacked) {
                        nostashraw -= Unstacked;
-                       if (nostashraw < 0) nostashraw = 0;
+                       if (nostashraw < 0) {
+                               Unstacked_missed = -nostashraw;
+                               nostashraw = 0;
+                       }
                        EnableMacros();
                }
                if (class(ch) == STIDF || class(ch) == STELL) {