Created
October 23, 2011 17:32
-
-
Save moritz/1307615 to your computer and use it in GitHub Desktop.
PIR version of Buf concatenation segfault
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 bb | |
$P0 = new 'ByteBuffer' | |
$P0 = 100 | |
$I0 = 0 | |
loop: | |
$I1 = $I0 + 1 | |
$P0[$I0] = $I1 | |
inc $I0 | |
unless $I0 == 100 goto loop | |
.return ($P0) | |
.end | |
.sub main :main | |
$P0 = new 'ByteBuffer' | |
$P0 = 1 | |
$P0[0] = 1 | |
$I0 = 0 | |
loop: | |
$P1 = 'bb'() | |
$S0 = $P0.'get_string'('binary') | |
$S1 = $P1.'get_string'('binary') | |
$S0 = concat $S0, $S1 | |
$P0 = new 'ByteBuffer' | |
$P0 = $S0 | |
inc $I0 | |
unless $I0 == 1000 goto loop | |
.end | |
# Local Variables: | |
# mode: pir | |
# fill-column: 100 | |
# End: | |
# vim: expandtab shiftwidth=4: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment