mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 16:39:36 +00:00
Avoid an redundant copy in pp_flop
This copy, which occurs with "a".."z" in list context, has been there since alphabetic ranges were added in commit b1248f16c (perl 3.0 patch #17 patch #16, continued). As a side effect, this: $ ./miniperl -lwe '()=my $undef1..my $undef2' Use of uninitialized value in range (or flop) at -e line 1. Use of uninitialized value in range (or flop) at -e line 1. becomes this: $ ./miniperl -lwe '()=my $undef1..my $undef2' Use of uninitialized value $undef2 in range (or flop) at -e line 1. Use of uninitialized value in range (or flop) at -e line 1. which is slightly better. :-)
This commit is contained in:
parent
d889390361
commit
c774086b8a
3
pp_ctl.c
3
pp_ctl.c
@ -1330,9 +1330,8 @@ PP(pp_flop)
|
||||
}
|
||||
}
|
||||
else {
|
||||
SV * const final = sv_mortalcopy(right);
|
||||
STRLEN len;
|
||||
const char * const tmps = SvPV_const(final, len);
|
||||
const char * const tmps = SvPV_const(right, len);
|
||||
|
||||
SV *sv = sv_mortalcopy(left);
|
||||
SvPV_force_nolen(sv);
|
||||
|
||||
@ -530,11 +530,11 @@ $v = ($m1 ... $m2);
|
||||
EXPECT
|
||||
Use of uninitialized value $m1 in range (or flop) at - line 7.
|
||||
Use of uninitialized value $m2 in range (or flop) at - line 8.
|
||||
Use of uninitialized value in range (or flop) at - line 9.
|
||||
Use of uninitialized value $m2 in range (or flop) at - line 9.
|
||||
Use of uninitialized value in range (or flop) at - line 9.
|
||||
Use of uninitialized value $m1 in range (or flop) at - line 12.
|
||||
Use of uninitialized value $m2 in range (or flop) at - line 13.
|
||||
Use of uninitialized value in range (or flop) at - line 14.
|
||||
Use of uninitialized value $m2 in range (or flop) at - line 14.
|
||||
Use of uninitialized value in range (or flop) at - line 14.
|
||||
########
|
||||
use warnings 'uninitialized';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user