diff options
author | Aaron Crane <arc@cpan.org> | 2014-10-20 15:22:52 +0100 |
---|---|---|
committer | Aaron Crane <arc@cpan.org> | 2014-10-20 21:43:38 +0100 |
commit | fa367bcbf78381959666f443b5f1d9da7870f943 (patch) | |
tree | f6875abf71ea6bb896a8ece94a5447226cb4ec90 /pp_sys.c | |
parent | 6aa683079638ed0b1923473b64317a0ef3a99849 (diff) | |
download | perl-fa367bcbf78381959666f443b5f1d9da7870f943.tar.gz |
Fix stack-management bug when semctl encounters errors
The success cases in pp_semctl both push a single value to the stack, but
the error case merely set the topmost stack value to undef. The fix is to
push an undef.
This bug manifests most obviously as an "uninitialized value in list slice"
warning when doing something like `my $test = (semctl -1,0,0,0)[0]`; that
was reported out-of-band to rjbs.
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4753,7 +4753,7 @@ PP(pp_semctl) const int anum = do_ipcctl(PL_op->op_type, MARK, SP); SP = MARK; if (anum == -1) - RETSETUNDEF; + RETPUSHUNDEF; if (anum != 0) { PUSHi(anum); } |