Created
April 30, 2015 20:23
-
-
Save lizmat/b005de9b024c73a10608 to your computer and use it in GitHub Desktop.
kill all backtraces, why????
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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