bug fix
authorceriel <none@none>
Thu, 5 Feb 1987 18:33:44 +0000 (18:33 +0000)
committerceriel <none@none>
Thu, 5 Feb 1987 18:33:44 +0000 (18:33 +0000)
modules/src/read_em/read_em.c
modules/src/read_em/readk.c

index a72f586..e0ddce8 100644 (file)
@@ -54,7 +54,10 @@ _fill()
 #define STRSIZ 256             /* Maximum length of strings */
 
 static struct e_instr emhead;  /* Where we put the head */
-static struct e_args emargs[NARGS];    /* Where we put the arguments */
+static struct e_args emargs[NARGS+2];  /* Where we put the arguments.
+                                          We need some more because some
+                                          arguments are constructed
+                                       */
 static struct e_args *i_emargs;
 #define argentry()     (i_emargs++)
 static struct string {
index 1ba9df6..49aa26d 100644 (file)
@@ -132,16 +132,17 @@ getarg(typset)
 
        case sp_doff:   /* A data label + offset */
        {
-               register struct e_args *ap1, *ap2;
+               register struct e_args *ap1;
 
                ap1 = getarg(lab_ptyp);
-               ap2 = getarg(cst_ptyp);
                *ap = *ap1;
-               if (ap->em_argtype == sof_ptyp) {       /* non-numeric label */
-                       ap->em_soff = ap2->em_cst;
+               i_emargs--;
+               ap1 = getarg(cst_ptyp);
+               if (argtyp == sof_ptyp) {       /* non-numeric label */
+                       ap->em_soff = ap1->em_cst;
                }
-               else    ap->em_noff = ap2->em_cst;
-               i_emargs -= 2;
+               else    ap->em_noff = ap1->em_cst;
+               i_emargs--;
                break;
        }
 
@@ -149,10 +150,10 @@ getarg(typset)
        case sp_ucon:   /* An unsigned constant */
        case sp_fcon:   /* A floating constant */
        {
-               register struct e_args *ap1;
                register struct string *p;
 
-               ap1 = getarg(cst_ptyp);
+               ap->em_size = getarg(cst_ptyp)->em_cst;
+               i_emargs--;
                p = getstring(0);
 #ifdef CHECKING
                if (state & INSTRING) {
@@ -161,8 +162,6 @@ getarg(typset)
 #endif CHECKING
                ap->em_argtype = ptyp(i);
                ap->em_str = p->str;
-               ap->em_size = ap1->em_cst;
-               i_emargs--;
                break;
        }