Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve double fault reporting
  • Loading branch information
sorear committed Oct 24, 2010
1 parent d1fae71 commit 6742210
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
16 changes: 8 additions & 8 deletions lib/Kernel.cs
Expand Up @@ -1195,7 +1195,7 @@ class ExitRunloopException : Exception { }
return sb.ToString();
}

private static bool in_unhandled;
private static object in_unhandled;

// exception processing goes in two stages
// 1. find the correct place to unwind to, calling CATCH filters
Expand Down Expand Up @@ -1230,16 +1230,16 @@ class ExitRunloopException : Exception { }
Variable mp = (type == SubInfo.ON_DIE) ? ((Variable)payload) :
BoxAny("Unhandled control operator: " +
SubInfo.DescribeControl(type, tgt, lid, name), StrP);
if (in_unhandled) {
Console.Error.WriteLine("Double fault {0}", type);
DynObject dob = mp.Fetch() as DynObject;
if (dob != null && dob.slots.Length != 0 &&
dob.slots[0] is string) {
Console.Error.WriteLine(dob.slots[0]);
}
if (in_unhandled != null) {
Console.Error.WriteLine("Double fault {0}", in_unhandled);
Environment.Exit(1);
}
in_unhandled = true;
DynObject dob = mp.Fetch() as DynObject;
if (dob != null && dob.slots.Length != 0 &&
dob.slots[0] is string) {
in_unhandled = dob.slots[0];
}
Frame r = th.MakeChild(null, UnhandledSI);
r.lex0 = mp;
return r;
Expand Down
4 changes: 2 additions & 2 deletions v6/TODO
@@ -1,5 +1,3 @@
Cursor.cursor_fresh
Cursor.mixin
Parcel.LISTSTORE
Highwater stuff

Expand All @@ -19,6 +17,8 @@ token { $param-role-var }

DONE:
~
Cursor.cursor_fresh
Cursor.mixin
<?{ }>
$/ and $¢ in subrule argument lists
<after>
Expand Down
5 changes: 4 additions & 1 deletion v6/tryfile
@@ -1,7 +1,7 @@
# vim: ft=perl6
use MONKEY_TYPING;

#use STD;
use STD;

sub infix:<min>($a,$b) { $a > $b ?? $b !! $a }

Expand Down Expand Up @@ -66,3 +66,6 @@ augment class Cursor {
method mixin($role) { self.cursor_fresh(self.WHAT but $role) }
}
STD.parse("2 + 2");
say "OK";

0 comments on commit 6742210

Please sign in to comment.