fixes
authorceriel <none@none>
Mon, 13 Jul 1987 11:49:32 +0000 (11:49 +0000)
committerceriel <none@none>
Mon, 13 Jul 1987 11:49:32 +0000 (11:49 +0000)
lang/m2/comp/chk_expr.c
lang/m2/comp/defmodule.c
lang/m2/comp/desig.c

index 612204f..2e6349a 100644 (file)
@@ -183,7 +183,8 @@ ChkLinkOrName(expp)
 
                if (! ChkDesignator(left)) return 0;
 
-               if ((left->nd_type->tp_fund != T_RECORD ||
+               if ((left->nd_class==Def || left->nd_class==LinkDef) &&
+                   (left->nd_type->tp_fund != T_RECORD ||
                    !(left->nd_def->df_kind & (D_MODULE|D_VARIABLE|D_FIELD))
                    )
                   ) {
@@ -211,7 +212,8 @@ Xerror(expp, "not exported from qualifying module", df);
                        }
                }
 
-               if (left->nd_def->df_kind == D_MODULE) {
+               if ((left->nd_class == Def || left->nd_class == LinkDef) &&
+                    left->nd_def->df_kind == D_MODULE) {
                        expp->nd_class = Def;
                        FreeNode(left);
                        expp->nd_left = 0;
@@ -221,7 +223,7 @@ Xerror(expp, "not exported from qualifying module", df);
 
        assert(expp->nd_class == Def);
 
-       return df->df_kind != D_ERROR;
+       return expp->nd_def->df_kind != D_ERROR;
 }
 
 STATIC int
index cde9c36..8362145 100644 (file)
@@ -155,7 +155,7 @@ GetDefinitionModule(id, incr)
                        id->id_text);
        }
        else if (df == Defined && level == 1) {
-               error("cannot import from currently defined module");
+               error("cannot import from current module \"%s\"", id->id_text);
                df->df_kind = D_ERROR;
        }
        FileName = fn;
index 42fb059..8d845cd 100644 (file)
@@ -269,12 +269,13 @@ CodeMove(rhs, left, rtp)
                                /*      Do a block move
                                */
                                struct desig l, r;
+                               arith sz;
 
                                sz = (size / word_size) * word_size;
                                l = *lhs; r = *rhs;
                                CodeAddress(&r);
                                CodeAddress(&l);
-                               C_blm(sz);
+                               C_blm((arith) sz);
                                rhs->dsg_offset += sz;
                                lhs->dsg_offset += sz;
                                size -= sz;
@@ -284,16 +285,16 @@ CodeMove(rhs, left, rtp)
                                        /*      Then copy dwords, words.
                                                Depend on peephole optimizer
                                        */
-                                       CodeCopy(lhs, rhs, sz, &size);
+                                       CodeCopy(lhs, rhs, (arith) sz, &size);
                                }
                        }
                        sz = word_size;
                        while (size && --sz) {
                                /*      And then copy remaining parts
                                */
-                               while (word_size % sz) sz--;
+                               while ((int) word_size % sz) sz--;
                                while (size >= sz) {
-                                       CodeCopy(lhs, rhs, sz, &size);
+                                       CodeCopy(lhs, rhs, (arith) sz, &size);
                                }
                        }
                        return;