Skip to content

Commit

Permalink
Use out of line code for throwing exceptions
Browse files Browse the repository at this point in the history
-12K to SAFE.dll
  • Loading branch information
sorear committed Aug 14, 2010
1 parent ea4bc04 commit 0e0c3d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions CgOp.pm
Expand Up @@ -589,8 +589,11 @@ use warnings;

sub die {
my ($msg) = @_;
$msg = fetch(string_var($msg)) unless blessed($msg);
rawccall(rawnew('Niecza.FatalException', $msg), 'SearchForHandler');
if (blessed($msg)) {
rawccall(rawnew('Niecza.FatalException', $msg), 'SearchForHandler');
} else {
rawsccall('Kernel.Die', clr_string($msg));
}
}

sub letn {
Expand Down
1 change: 1 addition & 0 deletions CodeGen.pm
Expand Up @@ -70,6 +70,7 @@ use 5.010;
'System.IO.File.ReadAllText' => [m => 'System.String'],
'Lexer.RunProtoregex' => [m => 'IP6[]'],
'Kernel.Die' => [c => 'Void'],
'Kernel.CoTake' => [c => 'Variable'],
'Kernel.Take' => [c => 'Variable'],
'Kernel.GatherHelper' => [c => 'Frame'],
Expand Down
2 changes: 1 addition & 1 deletion Sig.pm
Expand Up @@ -62,7 +62,7 @@ use 5.010;
} else {
return CgOp::prog(
CgOp::die("No value in " . $body->name .
"available for parameter " . $self->name),
" available for parameter " . $self->name),
CgOp::null('Variable'));
}
}
Expand Down

0 comments on commit 0e0c3d5

Please sign in to comment.