Skip to content

Commit

Permalink
BC: Do store av_pushx 0, as ix=0 represents Nullsv
Browse files Browse the repository at this point in the history
This fixes tests 9 and 10
  • Loading branch information
Reini Urban committed Nov 2, 2012
1 parent 7487063 commit 3f20007
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/B/Assembler.pm
Expand Up @@ -425,7 +425,7 @@ sub asm ($;$$) {
if ( defined $_[1] ) {
return
if $_[1] eq "0"
and $_[0] !~ /^(?:ldsv|stsv|newsvx?|newpadlx|av_extend|xav_flags)$/;
and $_[0] !~ /^(?:ldsv|stsv|newsvx?|newpadlx|av_pushx?|av_extend|xav_flags)$/;
return if $_[1] eq "1" and $]>5.007 and $_[0] =~ /^(?:sv_refcnt)$/;
}
my ( $insn, $arg, $comment ) = @_;
Expand Down
2 changes: 2 additions & 0 deletions lib/B/Bytecode.pm
Expand Up @@ -216,6 +216,7 @@ sub B::OP::ix {
sub B::SPECIAL::ix {
my $spec = shift;
my $ix = $spectab{$$spec};
# ix=0: Nullsv
defined($ix) ? $ix : do {
B::Assembler::maxsvix($tix) if $debug{A};
nice "[SPECIAL $tix]";
Expand Down Expand Up @@ -658,6 +659,7 @@ sub B::PAD::bsave {
$_ = $_->ix for @array; # save the elements
if ($debug{P}) {
warn " ix $ix: ",join(" ",@array),"\n";
# ix=0: Nullsv
}
$av->B::NULL::bsave($ix);
# av_extend always allocs 3
Expand Down

0 comments on commit 3f20007

Please sign in to comment.