Fix: sometimes generated illegal register messages for parameters
authorceriel <none@none>
Wed, 2 Oct 1991 12:00:05 +0000 (12:00 +0000)
committerceriel <none@none>
Wed, 2 Oct 1991 12:00:05 +0000 (12:00 +0000)
lang/cem/cemcom.ansi/idf.c
lang/cem/cemcom.ansi/util.c

index ebb9014..fe038bb 100644 (file)
@@ -536,14 +536,14 @@ declare_formals(idf, fp)
                        parameter starts on a new word boundary.
                */
                f_offset = align(f_offset + def->df_type->tp_size, (int) word_size);
+               RegisterAccount(def->df_address, def->df_type->tp_size,
+                               regtype(def->df_type),
+                               def->df_sc);
                /* cvt int to char or short and double to float, if necessary
                 */
                formal_cvt(hasproto, def);
 
                def->df_level = L_FORMAL2;      /* CJ */
-               RegisterAccount(def->df_address, def->df_type->tp_size,
-                               regtype(def->df_type),
-                               def->df_sc);
                if (nparams++ >= STDC_NPARAMS)
                        strict("number of formal parameters exceeds ANSI limit");
 #ifdef DBSYMTAB
index 4ffe7ed..fa51a52 100644 (file)
@@ -205,6 +205,7 @@ LoadLocal(off, sz)
        if (p) p->t_count++;
 #endif
 #endif
+       if (p && p->t_size != sz) p->t_regtype = -1;
        if (sz == word_size) C_lol(off);
        else if (sz == dword_size) C_ldl(off);
        else {
@@ -224,6 +225,7 @@ StoreLocal(off, sz)
        if (p) p->t_count++;
 #endif
 #endif
+       if (p && p->t_size != sz) p->t_regtype = -1;
        if (sz == word_size) C_stl(off);
        else if (sz == dword_size) C_sdl(off);
        else {