Created
March 12, 2010 10:24
-
-
Save jnthn/330215 to your computer and use it in GitHub Desktop.
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
.sub 'main' | |
# Load Perl 5 interpreter interop layer. | |
load_bytecode 'perl5.pbc' | |
say "Loaded" | |
$P0 = compreg 'perl5' | |
say "Got compiler" | |
# Try to load CGI.pm. | |
$P1 = new ['ResizablePMCArray'] | |
push $P1, 'CGI' | |
$P2 = $P0.'load_library'($P1) | |
$P2 = $P2['namespace'] | |
say "Loaded CGI" | |
# Try to call a package method. | |
$P3 = $P2.'new'() | |
say "Created new object" | |
# OH NOES HALP! After here we segfault. | |
$S0 = $P3.'header'() | |
say $S0 | |
say "Survived" | |
.end |
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
.sub 'main' | |
# Load Perl 5 interpreter interop layer. | |
load_bytecode 'perl5.pbc' | |
say "Loaded" | |
$P0 = compreg 'perl5' | |
say "Got compiler" | |
# Try to load CGI.pm. | |
$P1 = new ['ResizablePMCArray'] | |
push $P1, 'CGI' | |
$P2 = $P0.'load_library'($P1) | |
$P2 = $P2['namespace'] | |
say "Loaded CGI" | |
# Try to call a package method. | |
$S0 = $P2.'header'() | |
say $S0 | |
.end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment