From: andy Date: Thu, 9 Mar 2000 10:19:33 +0000 (+0000) Subject: [project @ 2000-03-09 10:19:33 by andy] X-Git-Tag: Approximately_9120_patches~5033 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c1556b843de5295fe1bc8cd3e79e0cd72a6fd3b1;p=ghc-hetmet.git [project @ 2000-03-09 10:19:33 by andy] Porting bug fix from Classic Hugs to STG Hugs. This was causing crashes when compiling large examples. Removing some dead code from static.c --- diff --git a/ghc/interpreter/static.c b/ghc/interpreter/static.c index b9dae73..e1504d1 100644 --- a/ghc/interpreter/static.c +++ b/ghc/interpreter/static.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: static.c,v $ - * $Revision: 1.26 $ - * $Date: 2000/03/09 06:14:38 $ + * $Revision: 1.27 $ + * $Date: 2000/03/09 10:19:33 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -467,27 +467,6 @@ Bool priv; { } } } -#if 0 - } else if (STAR == impList) { - List xs; - for(xs=module(m).names; nonNull(xs); xs=tl(xs)) { - Cell e = hd(xs); - imports = cons(e,imports); - } - for(xs=module(m).classes; nonNull(xs); xs=tl(xs)) { - Cell cl = hd(xs); - imports = cons(cl,imports); - imports = dupOnto(cclass(cl).members,imports); - } - for(xs=module(m).tycons; nonNull(xs); xs=tl(xs)) { - Cell t = hd(xs); - imports = cons(t,imports); - if (isTycon(t) - && (tycon(t).what == DATATYPE - || tycon(t).what == NEWTYPE)) - imports = dupOnto(tycon(t).defn,imports); - } -#endif } else { map2Accum(checkImportEntity,imports,m,priv,impList); } @@ -514,10 +493,10 @@ Pair importSpec; { hidden = resolveImportList(m, snd(impList),FALSE); imports = resolveImportList(m, DOTDOT,FALSE); } else if (isPair(impList) && STAR == fst(impList)) { - /* Somewhat inefficient - but obviously correct: - * imports = importsOf("module Foo") `setDifference` hidden; - */ - imports = resolveImportList(m, snd(impList),TRUE); + List privileged; + imports = resolveImportList(m, DOTDOT, FALSE); + privileged = resolveImportList(m, snd(impList),TRUE); + imports = dupOnto(privileged,imports); } else { imports = resolveImportList(m, impList,FALSE); } diff --git a/ghc/interpreter/subst.c b/ghc/interpreter/subst.c index 3ca1ed4..f97d866 100644 --- a/ghc/interpreter/subst.c +++ b/ghc/interpreter/subst.c @@ -10,8 +10,8 @@ * included in the distribution. * * $RCSfile: subst.c,v $ - * $Revision: 1.11 $ - * $Date: 2000/03/06 08:38:04 $ + * $Revision: 1.12 $ + * $Date: 2000/03/09 10:19:33 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -1350,9 +1350,15 @@ Cell pi1; /* Assumes preds are kind correct */ Int o1; /* with the same class. */ Cell pi; Int o; { - for (; isAp(pi1); pi1=fun(pi1), pi=fun(pi)) - if (!unify(arg(pi1),o1,arg(pi),o)) - return FALSE; + for (; isAp(pi1); pi1=fun(pi1), pi=fun(pi)) { + if (!isAp(pi) || !unify(arg(pi1),o1,arg(pi),o)) + return FALSE; + } + /* pi1 has exhausted its argument chain, we also need to check that + pi has no remaining arguments. However, under this condition, + the pi1 == pi will always return FALSE, giving the desired + result. */ + #if IPARAM if (isIP(pi1) && isIP(pi)) return textOf(pi1)==textOf(pi);