diff options
author | Leon Timmermans <fawaka@gmail.com> | 2011-09-13 20:13:22 +0200 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-09-14 12:50:00 -0700 |
commit | af8ff7274143ea04b0f17d1a1d34c1ee0f320c7e (patch) | |
tree | aa1a1f3fe91585f551cf3fee1472fb2a5540ef49 /doio.c | |
parent | 2d5385e000a5266aa7ee9c5f30f99861756fa401 (diff) | |
download | perl-af8ff7274143ea04b0f17d1a1d34c1ee0f320c7e.tar.gz |
Fix #98480 math when reading shared memory
shmread didn't unset SvIOK properly, causing a read into a SVIV to have
an incorrect numeric value. This patch fixes that and adds tests.
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2278,7 +2278,8 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp) /* suppress warning when reading into undef var (tchrist 3/Mar/00) */ if (! SvOK(mstr)) sv_setpvs(mstr, ""); - SvPV_force_nolen(mstr); + sv_upgrade(mstr, SVt_PV); + SvPOK_only(mstr); mbuf = SvGROW(mstr, (STRLEN)msize+1); Copy(shm + mpos, mbuf, msize, char); |