Fixed problem with missed unstacks

This commit is contained in:
ceriel 1993-03-30 09:41:00 +00:00
parent b371972acf
commit e9a4337ccf
3 changed files with 17 additions and 5 deletions

View file

@ -31,6 +31,7 @@
extern char *symbol2str(); extern char *symbol2str();
extern char options[]; extern char options[];
extern arith flt_flt2arith(); extern arith flt_flt2arith();
extern label code_string();
arithbalance(e1p, oper, e2p) /* 3.1.2.5 */ arithbalance(e1p, oper, e2p) /* 3.1.2.5 */
register struct expr **e1p, **e2p; register struct expr **e1p, **e2p;
@ -464,9 +465,9 @@ string2pointer(ex)
/* The expression, which must be a string constant, is converted /* The expression, which must be a string constant, is converted
to a pointer to the string-containing area. 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->ex_class = Value;
ex->VL_CLASS = Label; ex->VL_CLASS = Label;
ex->VL_LBL = lbl; ex->VL_LBL = lbl;

View file

@ -105,12 +105,13 @@ init_code(dst_file)
struct string_cst *str_list = 0; struct string_cst *str_list = 0;
code_string(val, len, dlb) label
code_string(val, len)
char *val; char *val;
int len; int len;
label dlb;
{ {
register struct string_cst *sc = new_string_cst(); register struct string_cst *sc = new_string_cst();
label lbl = data_label();
C_ina_dlb(dlb); C_ina_dlb(dlb);
sc->next = str_list; sc->next = str_list;
@ -118,6 +119,7 @@ code_string(val, len, dlb)
sc->sc_value = val; sc->sc_value = val;
sc->sc_len = len; sc->sc_len = len;
sc->sc_dlb = dlb; sc->sc_dlb = dlb;
return dlb;
} }
def_strings(sc) def_strings(sc)

View file

@ -308,14 +308,23 @@ actual(repl)
register int ch = 0; register int ch = 0;
register int level = 0, nostashraw = 0; register int level = 0, nostashraw = 0;
int lastch; int lastch;
static int Unstacked_missed;
while (1) { while (1) {
lastch = ch; lastch = ch;
ch = GetChar(); ch = GetChar();
if (nostashraw
&& nostashraw >= Unstacked_missed) {
nostashraw -= Unstacked_missed;
Unstacked_missed = 0;
}
if (Unstacked) { if (Unstacked) {
nostashraw -= Unstacked; nostashraw -= Unstacked;
if (nostashraw < 0) nostashraw = 0; if (nostashraw < 0) {
Unstacked_missed = -nostashraw;
nostashraw = 0;
}
EnableMacros(); EnableMacros();
} }
if (class(ch) == STIDF || class(ch) == STELL) { if (class(ch) == STIDF || class(ch) == STELL) {