Skip to content

Commit

Permalink
Fix systematic who -> how typo in kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Jun 23, 2011
1 parent 14c6eb4 commit 55ff541
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions lib/Kernel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@ public void LoadStashes(int from) {
string name = ReadStr(ref from);
object what = ReadXref(ref from);

if (TraceLoad)
Console.WriteLine("Creating stash slot {0} {1}", who, name);

BValue slot = Kernel.GetVar(who, name);
if (what == null) continue;

Expand Down Expand Up @@ -583,14 +586,14 @@ public STable LoadPackage(int from, STable existing_mo) {
int _ifrom = from;
int ix = ReadInt(ref from);
string name = ReadStr(ref from);
string how = ReadStr(ref from);
string who = ReadStr(ref from);
if (TraceLoad)
Console.WriteLine("Installing package {0} \"{1}\" from {2:X}", ix, name, _ifrom);
STable mo = existing_mo != null ? existing_mo :
new STable(name);
xref[ix] = mo;

mo.how = Kernel.GetStash(how);
mo.who = Kernel.GetStash(who);
mo.typeObject = new P6opaque(mo, 0);
((P6opaque)mo.typeObject).slots = null;
mo.typeVar = Kernel.NewROScalar(mo.typeObject);
Expand Down Expand Up @@ -3186,12 +3189,15 @@ public static Variable StashyMerge(Variable o, Variable n, string d1, string d2)
P6any oo = o.Fetch();
P6any nn = n.Fetch();

if (!oo.IsDefined() && !nn.IsDefined() && oo.mo.how == nn.mo.how) {
if (oo == nn) return o;

if (!oo.IsDefined() && !nn.IsDefined() && oo.mo.who == nn.mo.who) {
if (oo.mo.mo.isPackage) return n;
if (nn.mo.mo.isPackage) return o;
}

throw new NieczaException("Funny merge failure " + d1 + "::" + d2);
throw new NieczaException("Funny merge failure " + d1 + "::" + d2 +
" (" + oo.mo.name + ", " + nn.mo.name + ")");
}

public static BValue GetVar(string who, string name) {
Expand Down
2 changes: 1 addition & 1 deletion lib/ObjModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public static readonly PushyHandler CallUnshift

public P6how mo;

public P6any how;
public P6any how, who;
public P6any typeObject, initObject;
public Variable typeVar, initVar;
public int fixups_from;
Expand Down

0 comments on commit 55ff541

Please sign in to comment.