# New Ticket Created by  Shoichi Kaji 
# Please include the string:  [perl #126350]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=126350 >


The following script exits with segmentation fault.
(code is also available at
https://gist.github.com/shoichikaji/42f03675cec2d6b4a489)

```
#!/bin/bash

set -xu

rm -rf lib
mkdir lib

cat >lib/A.pm6 <<'EOF';
class B {}
class A {
    sub foo($b, *@) {}
    BEGIN {
        B.^add_method: 'bar', method () { foo(self) };
    }
}
EOF

perl6-m --target=mbc --output=lib/A.pm6.moarvm lib/A.pm6
perl6-m -Ilib -MA -e 'B.bar'
```

```
$ bash test.sh
+ rm -rf lib
+ mkdir lib
+ cat
+ perl6-m --target=mbc --output=lib/A.pm6.moarvm lib/A.pm6
+ perl6-m -Ilib -MA -e B.bar
test.sh: line 19: 31493 Segmentation fault      perl6-m -Ilib -MA -e 'B.bar'
```

My perl version is:
$ perl6-m -v
This is perl6 version 2015.09-360-g154f44b built on MoarVM version
2015.09-79-gee9fc2b

Reply via email to