Skip to content

Commit

Permalink
Fix use Test; $_ = 5
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Jul 14, 2011
1 parent 02fae77 commit 8d724eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/CLRBackend.cs
Expand Up @@ -4569,7 +4569,7 @@ public class CLRBackend {
thaw.Add(CpsOp.MethodCall(Tokens.RuntimeUnit.GetMethod("FixupSubs"),
CpsOp.GetSField(unit.rtunit)));

unit.VisitSubsPostorder(delegate(int ix, StaticSub obj) {
unit.VisitSubsPreorder(delegate(int ix, StaticSub obj) {
if (Verbose > 0) Console.WriteLine("sub3 {0}", obj.name);
foreach (KeyValuePair<string,Lexical> l in obj.lexicals) {
if (l.Value is LexCommon) {
Expand Down
18 changes: 9 additions & 9 deletions lib/Kernel.cs
Expand Up @@ -238,7 +238,7 @@ public sealed class RuntimeUnit {
this.methods = new DynBlockDelegate[nx];
this.meta_fields = new FieldInfo[nx*2];

Kernel.ModulesFinished.Add(name);
Kernel.ModulesFinished[name] = this;

if (TraceLoad) {
Console.WriteLine("Setting up unit {0}", type.Name);
Expand Down Expand Up @@ -2397,25 +2397,25 @@ public class Kernel {
GetInferiorRoot(), Variable.None, null));
}

internal static HashSet<string> ModulesStarted;
internal static HashSet<string> ModulesFinished;
internal static HashSet<string> ModulesStarted = new HashSet<string>();
internal static Dictionary<string,RuntimeUnit> ModulesFinished =
new Dictionary<string,RuntimeUnit>();

public static Variable BootModule(string name, DynBlockDelegate dgt) {
if (ModulesStarted == null) ModulesStarted = new HashSet<string>();
if (ModulesFinished == null) ModulesFinished = new HashSet<string>();
if (ModulesFinished.Contains(name))
if (ModulesFinished.ContainsKey(name))
return AnyMO.typeVar;
if (ModulesStarted.Contains(name))
throw new NieczaException("Recursive module graph detected at " + name + ": " + JoinS(" ", ModulesStarted));
ModulesStarted.Add(name);
Variable r = Kernel.RunInferior(Kernel.GetInferiorRoot().
MakeChild(null, new SubInfo("boot-" + name, dgt), AnyP));
ModulesFinished.Add(name);
if (!ModulesFinished.ContainsKey(name))
ModulesFinished[name] = null;
return r;
}

public static void DoRequire(string name) {
if (ModulesFinished.Contains(name))
if (ModulesFinished.ContainsKey(name))
return;
Assembly a = Assembly.Load(name);
Type t = a.GetType(name);
Expand Down Expand Up @@ -3043,7 +3043,7 @@ public class MMDCandidateLongname {
string n = th.info.name;
// Mega-Hack: These functions wrap stuff and should
// propagate $/
if (n == "CORE infix:<~~>" || n == "ExitRunloop") {
if (n == "CORE infix:<~~>" || n == "ExitRunloop" || n == "KERNEL AutoThreadSub") {
th = th.caller;
continue;
}
Expand Down

0 comments on commit 8d724eb

Please sign in to comment.