Permalink
Browse files

fixed bytecode issue 97

op_first is special cased for UNOPs because of rv2sv/av/hv for local refs
and require was missing as common case. There might be more UNOPs missing an op_first.
  • Loading branch information...
1 parent e65fbaa commit 7700c38e944046d36cc5125a33a7cb2169bccc65 Reini Urban committed Apr 17, 2012
Showing with 7 additions and 1 deletion.
  1. +3 −1 lib/B/Bytecode.pm
  2. +2 −0 t/testc.sh
  3. +2 −0 t/testplc.sh
View
@@ -746,10 +746,12 @@ sub B::UNOP::bsave {
&& $op->flags & OPf_MOD
&& $op->private & OPpLVAL_INTRO
- # change #18774 made my life hard
+ # change #18774 (localref) made my life hard (commit 82d039840b913b4)
? $first->ix
: 0;
+ # XXX Are there more new UNOP's with first?
+ $firstix = $first->ix if $name eq 'require'; #issue 97
$op->B::OP::bsave($ix);
asm "op_first", $firstix;
}
View
@@ -443,6 +443,8 @@ my IO::Socket::SSL $handle = new IO::Socket::SSL;
$handle->blocking(0);
print "ok";'
result[95]='ok'
+tests[97]='use v5.12; print q(ok);'
+result[97]='ok'
# from here on we test CC specifics only
View
@@ -363,6 +363,8 @@ tests[931]='my $f;BEGIN{open($f,"<README");}read $f,my $in, 2; print "ok"'
result[931]='ok'
tests[932]='my $f;BEGIN{open($f,">&STDOUT");}print $f "ok"'
result[932]='ok'
+tests[97]='use v5.12; print q(ok);'
+result[97]='ok'
init

0 comments on commit 7700c38

Please sign in to comment.