Skip to content

Instantly share code, notes, and snippets.

@lizmat
Created April 30, 2015 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lizmat/b005de9b024c73a10608 to your computer and use it in GitHub Desktop.
Save lizmat/b005de9b024c73a10608 to your computer and use it in GitHub Desktop.
kill all backtraces, why????
# Run any code that produces a backtrace with RAKUDO_VERBOSE_STACKFRAME=3
#
# The thinko was using $_ instead of $line - 1 as an index into @lines
# When that is done, it appears that the method is immediately exited without returning anything,
# effectively removing *any* stacktrace information. I assume this is some vague interaction with
# the lazy list machinery / reification / whatever.
$ git diff
diff --git a/src/core/Backtrace.pm b/src/core/Backtrace.pm
index e524228..8b6af4e 100644
--- a/src/core/Backtrace.pm
+++ b/src/core/Backtrace.pm
@@ -30,7 +30,7 @@ my class Backtrace::Frame {
my $to = min $!line + $extra, +@lines;
for $from..$to -> $line {
my $star = $line == $!line ?? '*' !! ' ';
- $text ~= "$line.fmt('%5d') $star@lines[$line - 1]\n";
+ $text ~= "$line.fmt('%5d') $star@lines[$_]\n";
}
$text ~= "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment