Skip to content

Commit

Permalink
Lose the <unit-outer> in backtraces
Browse files Browse the repository at this point in the history
The lazification of backtraces accidentally included the <unit-outer> scope,
where it didn't before.
  • Loading branch information
lizmat committed May 26, 2015
1 parent d5eabd4 commit c2a57ec
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/core/Backtrace.pm
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,12 @@ my class Backtrace {
}

method AT-POS($pos) {
if nqp::existspos($!frames,$pos) {
return nqp::atpos($!frames,$pos);
}
return nqp::atpos($!frames,$pos) if nqp::existspos($!frames,$pos);

my int $elems = $!bt.elems;
my int $todo = $pos - nqp::elems($!frames) + 1;
return Nil if $!bt-next == $elems;

my int $todo = $pos - nqp::elems($!frames) + 1;
while $!bt-next < $elems {

my $frame := $!bt.AT-POS($!bt-next++);
Expand Down Expand Up @@ -127,8 +126,16 @@ my class Backtrace {
last unless $todo = $todo - 1;
}

# whatever is there (or not)
nqp::existspos($!frames,$pos) ?? nqp::atpos($!frames,$pos) !! Nil;
# found something
if nqp::existspos($!frames,$pos) {
nqp::atpos($!frames,$pos);
}

# we've reached the end, don't show the last <unit-outer>
else {
nqp::pop($!frames);
Nil;
}
}

method next-interesting-index(Backtrace:D:
Expand Down

0 comments on commit c2a57ec

Please sign in to comment.