-
-
Save bdw/992dfd5b69b7d42f2239 to your computer and use it in GitHub Desktop.
dynvar bug
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
# without JIT | |
# very many of these | |
F $*IN_RETURN 14 10 4 11 | |
C $*IN_RETURN 1 0 0 1 | |
# then after inlining | |
I $*IN_RETURN 14 16 2 12 | |
C $*IN_RETURN 1 0 0 1 | |
# with JIT | |
F $*IN_RETURN 14 10 4 11 | |
C $*IN_RETURN 1 0 0 1 | |
# then a few of: | |
I $*IN_RETURN 14 16 2 12 | |
C $*IN_RETURN 1 0 0 1 | |
# and finally | |
F $*IN_RETURN 16 21 2 15 | |
C $*IN_RETURN 1 1 0 1 | |
# notably, that is two frames higher up! |
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
use v6; | |
class C::C { }; | |
# this causes a mislookup in the compiler, | |
# which in turn causes a miscompile, | |
# which in turn causes a crash, | |
# which is what we notice | |
EVAL 'sub foo() { return C::C.new(a => 1, b => 2) }; foo()' for ^500 |
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
# this code is inlined/notinlined and has a dynvar ref | |
# but for some reason it doesn't reproduce the bug | |
# probably because the getdynlex seems to be speshed out | |
my $bar := 1; | |
my sub not-inlined() { | |
$bar * $*FOO; | |
} | |
my sub inlined-assign-dynvar() { | |
my $*FOO := 2; | |
not-inlined() + not-inlined(); | |
} | |
my sub toplevel-inliner() { | |
my $*FOO := 0; | |
my $sum := inlined-assign-dynvar() + not-inlined(); | |
nqp::die("oh no") if $sum != 4; | |
} | |
my $i := 0; | |
while $i < 500 { | |
$i := $i + 1; | |
toplevel-inliner(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment