summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-08-26 06:20:01 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-08-26 08:24:20 -0700
commitf132ae694cadce5cea5b006969b9b9ad169ecf64 (patch)
tree17870ff80fdfd752b80df30ac27e24d22878bcc9 /pp.c
parenta12b8f3cd0656f16670bb2f2237cb55165d464e6 (diff)
downloadperl-f132ae694cadce5cea5b006969b9b9ad169ecf64.tar.gz
Make *{undef} self-consistent
Commit afd1915d made filehandle vivification work on hash and array elements, but in doing so it accidentally changed *{;undef} = 3; to do the same thing as *{""} = 3; while leaving *{$some_undefined_variable} an error. This commit adjusts the if() conditions in S_rv2gv (formerly in pp_rv2gv) in pp.c to make PL_sv_undef follow the same path as before. It also removes the uninit tests from lib/warnings/pp, since they are now errors. The uninit warning in rv2gv is only triggered now when it is implicit, as in close(). That is already tested in lib/warnings/9uninit.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index ea6eb00504..e2427f8e8b 100644
--- a/pp.c
+++ b/pp.c
@@ -176,11 +176,11 @@ S_rv2gv(pTHX_ SV *sv, const bool vivify_sv, const bool strict,
}
else {
if (!isGV_with_GP(sv)) {
- if (!SvOK(sv) && sv != &PL_sv_undef) {
+ if (!SvOK(sv)) {
/* If this is a 'my' scalar and flag is set then vivify
* NI-S 1999/05/07
*/
- if (vivify_sv) {
+ if (vivify_sv && sv != &PL_sv_undef) {
GV *gv;
if (SvREADONLY(sv))
Perl_croak_no_modify(aTHX);