From 8dfafeb4e37b3f429ec9c1d1fa121734a9c64780 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 13 Jul 1987 11:49:32 +0000 Subject: [PATCH] fixes --- lang/m2/comp/chk_expr.c | 8 +++++--- lang/m2/comp/defmodule.c | 2 +- lang/m2/comp/desig.c | 9 +++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lang/m2/comp/chk_expr.c b/lang/m2/comp/chk_expr.c index 612204fa9..2e6349a4f 100644 --- a/lang/m2/comp/chk_expr.c +++ b/lang/m2/comp/chk_expr.c @@ -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 diff --git a/lang/m2/comp/defmodule.c b/lang/m2/comp/defmodule.c index cde9c363d..83621456c 100644 --- a/lang/m2/comp/defmodule.c +++ b/lang/m2/comp/defmodule.c @@ -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; diff --git a/lang/m2/comp/desig.c b/lang/m2/comp/desig.c index 42fb05949..8d845cd3c 100644 --- a/lang/m2/comp/desig.c +++ b/lang/m2/comp/desig.c @@ -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; -- 2.34.1