X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Finterpreter%2Fscc.c;h=ba3b456afb59ce91c661ff6ca67f9fad1e64247e;hb=b034fbda464c20850831fc6f8b0c706b2afe34bd;hp=809d54a874fbdbbd696c542ed549a8c21972afe4;hpb=57131ad0203977941eb50d60550fa82e88614496;p=ghc-hetmet.git diff --git a/ghc/interpreter/scc.c b/ghc/interpreter/scc.c index 809d54a..ba3b456 100644 --- a/ghc/interpreter/scc.c +++ b/ghc/interpreter/scc.c @@ -2,14 +2,15 @@ /* -------------------------------------------------------------------------- * Strongly connected components algorithm for static.c. * - * Hugs 98 is Copyright (c) Mark P Jones, Alastair Reid and the Yale - * Haskell Group 1994-99, and is distributed as Open Source software - * under the Artistic License; see the file "Artistic" that is included - * in the distribution for details. + * The Hugs 98 system is Copyright (c) Mark P Jones, Alastair Reid, the + * Yale Haskell Group, and the Oregon Graduate Institute of Science and + * Technology, 1994-1999, All rights reserved. It is distributed as + * free software under the license in the file "License", which is + * included in the distribution. * * $RCSfile: scc.c,v $ - * $Revision: 1.3 $ - * $Date: 1999/02/03 17:08:36 $ + * $Revision: 1.5 $ + * $Date: 1999/10/15 21:40:54 $ * ------------------------------------------------------------------------*/ #ifndef SCC_C @@ -74,20 +75,23 @@ Cell v; { #ifdef SCC static List local SCC(bs) /* sort list with added dependency */ List bs; { /* info into SCCs */ + List tmp = NIL; clearStack(); daSccs = NIL; /* clear current list of SCCs */ for (daCount=1; nonNull(bs); bs=tl(bs)) /* visit each binding */ if (!visited(hd(bs))) LOWLINK(hd(bs)); - - return rev(daSccs); /* reverse to obtain correct order */ + tmp = rev(daSccs); + daSccs = NIL; + return tmp; /* reverse to obtain correct order */ } #endif #ifdef SCC2 /* Two argument version */ static List local SCC2(bs,cs) /* sort lists with added dependency*/ List bs, cs; { /* info into SCCs */ + List tmp = NIL; clearStack(); daSccs = NIL; /* clear current list of SCCs */ @@ -97,8 +101,9 @@ List bs, cs; { /* info into SCCs */ for (; nonNull(cs); cs=tl(cs)) if (!visited(hd(cs))) LOWLINK(hd(cs)); - - return rev(daSccs); /* reverse to obtain correct order */ + tmp = rev(daSccs); + daSccs = NIL; + return tmp; /* reverse to obtain correct order */ } #endif