Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
skip too if line is not defined
The line number and file is not guaranteed to be set. Calling .Int on an undefined
value would explode, so we move that to after the skip.
  • Loading branch information
FROGGS committed Jan 24, 2014
1 parent 24c544b commit 387664f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Backtrace.pm
Expand Up @@ -59,7 +59,7 @@ my class Backtrace is List {
$code := nqp::getcodeobj($sub);
$code := Any unless nqp::istype($code, Mu);
};
my $line = $bt[$_]<annotations><line>.Int;
my $line = $bt[$_]<annotations><line>;
my $file = $bt[$_]<annotations><file>;
next unless $line && $file;
# now *that's* an evil hack
Expand All @@ -78,7 +78,7 @@ my class Backtrace is List {
my $subname = nqp::p6box_s(nqp::getcodename($sub));
$subname = '<anon>' if $subname.substr(0, 6) eq '_block';
$new.push: Backtrace::Frame.new(
:$line,
:line($line.Int),
:$file,
:$subname,
:$code,
Expand Down

0 comments on commit 387664f

Please sign in to comment.