diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2008-06-22 19:05:31 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2008-06-22 19:05:31 +0000 |
commit | 8b0dea507b8f946d8546917b8fda74bfbf233ac0 (patch) | |
tree | b8655ccd4befccb5eacf2fa46b7f914d3cb5a34b /sv.c | |
parent | a73918ec93a602356d85f41060eaacc67da45b23 (diff) | |
download | perl-8b0dea507b8f946d8546917b8fda74bfbf233ac0.tar.gz |
Incorrect variable reported in uninitialized value warning.
Ops that can return undef even for defined args, could mistakenly
warn that the arg was undefined.
p4raw-id: //depot/perl@34077
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 72 |
1 files changed, 70 insertions, 2 deletions
@@ -12594,8 +12594,75 @@ S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match) case OP_ENTEREVAL: /* could be eval $undef or $x='$undef'; eval $x */ case OP_RV2SV: - case OP_CUSTOM: - match = 1; /* XS or custom code could trigger random warnings */ + case OP_CUSTOM: /* XS or custom code could trigger random warnings */ + + /* the following ops are capable of returning PL_sv_undef even for + * defined arg(s) */ + + case OP_BACKTICK: + case OP_PIPE_OP: + case OP_FILENO: + case OP_BINMODE: + case OP_TIED: + case OP_GETC: + case OP_SYSREAD: + case OP_SEND: + case OP_IOCTL: + case OP_SOCKET: + case OP_SOCKPAIR: + case OP_BIND: + case OP_CONNECT: + case OP_LISTEN: + case OP_ACCEPT: + case OP_SHUTDOWN: + case OP_SSOCKOPT: + case OP_GETPEERNAME: + case OP_FTRREAD: + case OP_FTRWRITE: + case OP_FTREXEC: + case OP_FTROWNED: + case OP_FTEREAD: + case OP_FTEWRITE: + case OP_FTEEXEC: + case OP_FTEOWNED: + case OP_FTIS: + case OP_FTZERO: + case OP_FTSIZE: + case OP_FTFILE: + case OP_FTDIR: + case OP_FTLINK: + case OP_FTPIPE: + case OP_FTSOCK: + case OP_FTBLK: + case OP_FTCHR: + case OP_FTTTY: + case OP_FTSUID: + case OP_FTSGID: + case OP_FTSVTX: + case OP_FTTEXT: + case OP_FTBINARY: + case OP_FTMTIME: + case OP_FTATIME: + case OP_FTCTIME: + case OP_READLINK: + case OP_OPEN_DIR: + case OP_READDIR: + case OP_TELLDIR: + case OP_SEEKDIR: + case OP_REWINDDIR: + case OP_CLOSEDIR: + case OP_GMTIME: + case OP_ALARM: + case OP_SEMGET: + case OP_GETLOGIN: + case OP_UNDEF: + case OP_SUBSTR: + case OP_AEACH: + case OP_EACH: + case OP_SORT: + case OP_CALLER: + case OP_DOFILE: + match = 1; goto do_op; case OP_ENTERSUB: @@ -12607,6 +12674,7 @@ S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match) Need a better fix at dome point. DAPM 11/2007 */ break; + case OP_POS: /* def-ness of rval pos() is independent of the def-ness of its arg */ if ( !(obase->op_flags & OPf_MOD)) |