{
if (getinfo)
{
- SvPV_force_nolen(astr);
+ /* we're not using the value here, so don't SvPVanything */
+ SvUPGRADE(astr, SVt_PV);
+ SvGETMAGIC(astr);
+ if (SvTHINKFIRST(astr))
+ sv_force_normal_flags(astr, 0);
a = SvGROW(astr, infosize+1);
}
else
{
STRLEN len;
- a = SvPV(astr, len);
+ a = SvPVbyte(astr, len);
if (len != infosize)
Perl_croak(aTHX_ "Bad arg length for %s, is %lu, should be %ld",
PL_op_desc[optype],
}
else
{
- const IV i = SvIV(astr);
- a = INT2PTR(char *,i); /* ouch */
+ /* We historically treat this as a pointer if we don't otherwise recognize
+ the op, but for many ops the value is simply ignored anyway, so
+ don't warn on undef.
+ */
+ SvGETMAGIC(astr);
+ if (SvOK(astr)) {
+ const IV i = SvIV_nomg(astr);
+ a = INT2PTR(char *,i); /* ouch */
+ }
+ else {
+ a = NULL;
+ }
}
SETERRNO(0,0);
switch (optype)
if (getinfo && ret >= 0) {
SvCUR_set(astr, infosize);
*SvEND(astr) = '\0';
+ SvPOK_only(astr);
SvSETMAGIC(astr);
}
return ret;
const I32 id = SvIVx(*++mark);
SV * const mstr = *++mark;
const I32 flags = SvIVx(*++mark);
- const char * const mbuf = SvPV_const(mstr, len);
+ const char * const mbuf = SvPVbyte(mstr, len);
const I32 msize = len - sizeof(long);
PERL_ARGS_ASSERT_DO_MSGSND;
}
if (ret >= 0) {
SvCUR_set(mstr, sizeof(long)+ret);
+ SvPOK_only(mstr);
*SvEND(mstr) = '\0';
/* who knows who has been playing with this message? */
SvTAINTED_on(mstr);
STRLEN opsize;
const I32 id = SvIVx(*++mark);
SV * const opstr = *++mark;
- const char * const opbuf = SvPV_const(opstr, opsize);
+ const char * const opbuf = SvPVbyte(opstr, opsize);
PERL_ARGS_ASSERT_DO_SEMOP;
PERL_UNUSED_ARG(sp);