case OP_SPLIT:
case OP_MATCH:
case OP_QR:
- forget_pmop((PMOP*)o);
+ forget_pmop(cPMOPo);
}
if (o->op_flags & OPf_KIDS) {
if ((o->op_private & ~OPpASSIGN_BACKWARDS) != 2)
break;
- rv2gv = ((BINOP *)o)->op_last;
+ rv2gv = cBINOPo->op_last;
if (!rv2gv || rv2gv->op_type != OP_RV2GV)
break;
- refgen = (UNOP *)((BINOP *)o)->op_first;
+ refgen = cUNOPx(cBINOPo->op_first);
if (!refgen || (refgen->op_type != OP_REFGEN
&& refgen->op_type != OP_SREFGEN))
break;
- exlist = (LISTOP *)refgen->op_first;
+ exlist = cLISTOPx(refgen->op_first);
if (!exlist || exlist->op_type != OP_NULL
|| exlist->op_targ != OP_LIST)
break;
&& exlist->op_first != exlist->op_last)
break;
- rv2cv = (UNOP*)exlist->op_last;
+ rv2cv = cUNOPx(exlist->op_last);
if (rv2cv->op_type != OP_RV2CV)
break;
if (rop) {
if (rop->op_first->op_type == OP_PADSV)
/* @$hash{qw(keys here)} */
- rop = (UNOP*)rop->op_first;
+ rop = cUNOPx(rop->op_first);
else {
/* @{$hash}{qw(keys here)} */
if (rop->op_first->op_type == OP_SCOPE
&& cLISTOPx(rop->op_first)->op_last->op_type == OP_PADSV)
{
- rop = (UNOP*)cLISTOPx(rop->op_first)->op_last;
+ rop = cUNOPx(cLISTOPx(rop->op_first)->op_last);
}
else
rop = NULL;
&& (fields = (GV**)hv_fetchs(PadnameTYPE(lexname), "FIELDS", FALSE))
&& isGV(*fields) && GvHV(*fields);
- for (; key_op; key_op = (SVOP*)OpSIBLING(key_op)) {
+ for (; key_op; key_op = cSVOPx(OpSIBLING(key_op))) {
SV **svp, *sv;
if (key_op->op_type != OP_CONST)
continue;
!(o->op_flags & OPf_STACKED)) {
OpTYPE_set(o, OP_RV2CV); /* entersub => rv2cv */
assert(cUNOPo->op_first->op_type == OP_NULL);
- op_null(((LISTOP*)cUNOPo->op_first)->op_first);/* disable pushmark */
+ op_null(cLISTOPx(cUNOPo->op_first)->op_first);/* disable pushmark */
break;
}
else { /* lvalue subroutine call */
OpTYPE_set(o, OP_RV2CV); /* entersub => rv2cv */
assert(cUNOPo->op_first->op_type == OP_NULL);
/* disable pushmark */
- op_null(((LISTOP*)cUNOPo->op_first)->op_first);
+ op_null(cLISTOPx(cUNOPo->op_first)->op_first);
o->op_flags |= OPf_SPECIAL;
}
else if (type == OP_RV2SV || type == OP_RV2AV || type == OP_RV2HV){
else {
/* The listop in rops might have a pushmark at the beginning,
which will mess up list assignment. */
- LISTOP * const lrops = (LISTOP *)rops; /* for brevity */
+ LISTOP * const lrops = cLISTOPx(rops); /* for brevity */
if (rops->op_type == OP_LIST &&
lrops->op_first && lrops->op_first->op_type == OP_PUSHMARK)
{
else if (o->op_type == OP_LINESEQ) {
OP *kid;
OpTYPE_set(o, OP_SCOPE);
- kid = ((LISTOP*)o)->op_first;
+ kid = cLISTOPo->op_first;
if (kid->op_type == OP_NEXTSTATE || kid->op_type == OP_DBSTATE) {
op_null(kid);
av = (AV *)SvREFCNT_inc_NN(*PL_stack_sp--);
/* replace subtree with an OP_CONST */
- curop = ((UNOP*)o)->op_first;
+ curop = cUNOPo->op_first;
op_sibling_splice(o, NULL, -1, newSVOP(OP_CONST, 0, (SV *)av));
op_free(curop);
return newLISTOP(type, 0, first, last);
}
- op_sibling_splice(first, ((LISTOP*)first)->op_last, 0, last);
+ op_sibling_splice(first, cLISTOPx(first)->op_last, 0, last);
first->op_flags |= OPf_KIDS;
return first;
}
if (last->op_type != (unsigned)type)
return op_append_elem(type, first, last);
- OpMORESIB_set(((LISTOP*)first)->op_last, ((LISTOP*)last)->op_first);
- ((LISTOP*)first)->op_last = ((LISTOP*)last)->op_last;
- OpLASTSIB_set(((LISTOP*)first)->op_last, first);
+ OpMORESIB_set(cLISTOPx(first)->op_last, cLISTOPx(last)->op_first);
+ cLISTOPx(first)->op_last = cLISTOPx(last)->op_last;
+ OpLASTSIB_set(cLISTOPx(first)->op_last, first);
first->op_flags |= (last->op_flags & OPf_KIDS);
S_op_destroy(aTHX_ last);
if (binop->op_last)
OpLASTSIB_set(binop->op_last, (OP*)binop);
- binop = (BINOP*)CHECKOP(type, binop);
+ binop = (BINOP*) CHECKOP(type, binop);
if (binop->op_next || binop->op_type != (OPCODE)type)
return (OP*)binop;
* The rhs of the tr/// is here referred to as the r side.
*/
- SV * const tstr = ((SVOP*)expr)->op_sv;
- SV * const rstr = ((SVOP*)repl)->op_sv;
+ SV * const tstr = cSVOPx(expr)->op_sv;
+ SV * const rstr = cSVOPx(repl)->op_sv;
STRLEN tlen;
STRLEN rlen;
const U8 * t0 = (U8*)SvPV_const(tstr, tlen);
}
PL_hints |= HINT_BLOCK_SCOPE;
- pm = (PMOP*)o;
+ pm = cPMOPo;
assert(floor==0 || (pm->op_pmflags & PMf_HAS_CV));
if (is_compiletime) {
* squirrel away expr in op_code_list without the peephole
* optimiser etc processing it for a second time */
OP *qr = newPMOP(OP_QR, 0);
- ((PMOP*)qr)->op_code_list = expr;
+ cPMOPx(qr)->op_code_list = expr;
/* handle the implicit sub{} wrapped round the qr/(?{..})/ */
SvREFCNT_inc_simple_void(PL_compcv);
if (expr->op_type == OP_REGCRESET || expr->op_type == OP_REGCMAYBE) {
LINKLIST(expr);
rcop->op_next = expr;
- ((UNOP*)expr)->op_first->op_next = (OP*)rcop;
+ cUNOPx(expr)->op_first->op_next = (OP*)rcop;
}
else {
rcop->op_next = LINKLIST(expr);
PERL_ARGS_ASSERT_NEWSVOP;
+ /* OP_RUNCV is allowed specially so rpeep has room to convert it into an
+ * OP_CONST */
assert((PL_opargs[type] & OA_CLASS_MASK) == OA_SVOP
|| (PL_opargs[type] & OA_CLASS_MASK) == OA_PVOP_OR_SVOP
|| (PL_opargs[type] & OA_CLASS_MASK) == OA_FILESTATOP
+ || type == OP_RUNCV
|| type == OP_CUSTOM);
NewOp(1101, svop, 1, SVOP);
flags &= ~SVf_UTF8;
assert((PL_opargs[type] & OA_CLASS_MASK) == OA_PVOP_OR_SVOP
- || type == OP_RUNCV || type == OP_CUSTOM
+ || type == OP_CUSTOM
|| (PL_opargs[type] & OA_CLASS_MASK) == OA_LOOPEXOP);
NewOp(1101, pvop, 1, PVOP);
veop = NULL;
if (version) {
- SV * const vesv = ((SVOP*)version)->op_sv;
+ SV * const vesv = cSVOPx(version)->op_sv;
if (!arg && !SvNIOKp(vesv)) {
arg = version;
Perl_croak(aTHX_ "Version number must be a constant number");
/* Make copy of idop so we don't free it twice */
- pack = newSVOP(OP_CONST, 0, newSVsv(((SVOP*)idop)->op_sv));
+ pack = newSVOP(OP_CONST, 0, newSVsv(cSVOPx(idop)->op_sv));
/* Fake up a method call to VERSION */
meth = newSVpvs_share("VERSION");
if (arg && arg->op_type == OP_STUB) {
imop = arg; /* no import on explicit () */
}
- else if (SvNIOKp(((SVOP*)idop)->op_sv)) {
+ else if (SvNIOKp(cSVOPx(idop)->op_sv)) {
imop = NULL; /* use 5.0; */
if (aver)
- use_version = ((SVOP*)idop)->op_sv;
+ use_version = cSVOPx(idop)->op_sv;
else
idop->op_private |= OPpCONST_NOVER;
}
SV *meth;
/* Make copy of idop so we don't free it twice */
- pack = newSVOP(OP_CONST, 0, newSVsv(((SVOP*)idop)->op_sv));
+ pack = newSVOP(OP_CONST, 0, newSVsv(cSVOPx(idop)->op_sv));
/* Fake up a method call to import/unimport */
meth = aver
if (OP_TYPE_IS_OR_WAS(left, OP_LIST))
{
- OP *lop = ((LISTOP*)left)->op_first, *vop, *eop;
+ OP *lop = cLISTOPx(left)->op_first, *vop, *eop;
if (!(left->op_flags & OPf_PARENS) &&
lop->op_type == OP_PUSHMARK &&
(vop = OpSIBLING(lop)) &&
OP *gvop = NULL;
if ( ( left->op_type == OP_RV2AV
- && (gvop=((UNOP*)left)->op_first)->op_type==OP_GV)
+ && (gvop=cUNOPx(left)->op_first)->op_type==OP_GV)
|| left->op_type == OP_PADAV)
{
/* @pkg or @lex or local @pkg' or 'my @lex' */
OP *tmpop;
if (gvop) {
#ifdef USE_ITHREADS
- ((PMOP*)right)->op_pmreplrootu.op_pmtargetoff
+ cPMOPx(right)->op_pmreplrootu.op_pmtargetoff
= cPADOPx(gvop)->op_padix;
cPADOPx(gvop)->op_padix = 0; /* steal it */
#else
- ((PMOP*)right)->op_pmreplrootu.op_pmtargetgv
+ cPMOPx(right)->op_pmreplrootu.op_pmtargetgv
= MUTABLE_GV(cSVOPx(gvop)->op_sv);
cSVOPx(gvop)->op_sv = NULL; /* steal it */
#endif
left->op_private & OPpOUR_INTRO;
}
else {
- ((PMOP*)right)->op_pmreplrootu.op_pmtargetoff = left->op_targ;
+ cPMOPx(right)->op_pmreplrootu.op_pmtargetoff = left->op_targ;
left->op_targ = 0; /* steal it */
right->op_private |= OPpSPLIT_LEX;
}
detach_split:
tmpop = cUNOPo->op_first; /* to list (nulled) */
- tmpop = ((UNOP*)tmpop)->op_first; /* to pushmark */
+ tmpop = cUNOPx(tmpop)->op_first; /* to pushmark */
assert(OpSIBLING(tmpop) == right);
assert(!OpHAS_SIBLING(right));
/* detach the split subtreee from the o tree,
goto detach_split;
}
else if (PL_modcount < RETURN_UNLIMITED_NUMBER &&
- ((LISTOP*)right)->op_last->op_type == OP_CONST)
+ cLISTOPx(right)->op_last->op_type == OP_CONST)
{
/* convert split(...,0) to split(..., PL_modcount+1) */
SV ** const svp =
- &((SVOP*)((LISTOP*)right)->op_last)->op_sv;
+ &cSVOPx(cLISTOPx(right)->op_last)->op_sv;
SV * const sv = *svp;
if (SvIOK(sv) && SvIVX(sv) == 0)
{
no_bareword_allowed(cstop);
else if ((cstop->op_private & OPpCONST_BARE))
Perl_ck_warner(aTHX_ packWARN(WARN_BAREWORD), "Bareword found in conditional");
- if ((type == OP_AND && SvTRUE(((SVOP*)cstop)->op_sv)) ||
- (type == OP_OR && !SvTRUE(((SVOP*)cstop)->op_sv)) ||
- (type == OP_DOR && !SvOK(((SVOP*)cstop)->op_sv))) {
+ if ((type == OP_AND && SvTRUE(cSVOPx(cstop)->op_sv)) ||
+ (type == OP_OR && !SvTRUE(cSVOPx(cstop)->op_sv)) ||
+ (type == OP_DOR && !SvOK(cSVOPx(cstop)->op_sv))) {
/* Elide the (constant) lhs, since it can't affect the outcome */
*firstp = NULL;
if (other->op_type == OP_CONST)
else if ((first->op_flags & OPf_KIDS) && type != OP_DOR
&& ckWARN(WARN_MISC)) /* [#24076] Don't warn for <FH> err FOO. */
{
- const OP * const k1 = ((UNOP*)first)->op_first;
+ const OP * const k1 = cUNOPx(first)->op_first;
const OP * const k2 = OpSIBLING(k1);
OPCODE warnop = 0;
switch (first->op_type)
scalarboolean(first);
if ((cstop = search_const(first))) {
/* Left or right arm of the conditional? */
- const bool left = SvTRUE(((SVOP*)cstop)->op_sv);
+ const bool left = SvTRUE(cSVOPx(cstop)->op_sv);
OP *live = left ? trueop : falseop;
OP *const dead = left ? falseop : trueop;
if (cstop->op_private & OPpCONST_BARE &&
if (expr) {
if (once && (
- (expr->op_type == OP_CONST && !SvTRUE(((SVOP*)expr)->op_sv))
+ (expr->op_type == OP_CONST && !SvTRUE(cSVOPx(expr)->op_sv))
|| ( expr->op_type == OP_NOT
&& cUNOPx(expr)->op_first->op_type == OP_CONST
&& SvTRUE(cSVOPx_sv(cUNOPx(expr)->op_first))
expr = newUNOP(OP_DEFINED, 0,
newASSIGNOP(0, newDEFSVOP(), 0, expr) );
} else if (expr->op_flags & OPf_KIDS) {
- const OP * const k1 = ((UNOP*)expr)->op_first;
+ const OP * const k1 = cUNOPx(expr)->op_first;
const OP * const k2 = k1 ? OpSIBLING(k1) : NULL;
switch (expr->op_type) {
case OP_NULL:
}
if (listop)
- ((LISTOP*)listop)->op_last->op_next = LINKLIST(o);
+ cLISTOPx(listop)->op_last->op_next = LINKLIST(o);
if (once && o != listop)
{
assert(cUNOPo->op_first->op_type == OP_AND
|| cUNOPo->op_first->op_type == OP_OR);
- o->op_next = ((LOGOP*)cUNOPo->op_first)->op_other;
+ o->op_next = cLOGOPx(cUNOPo->op_first)->op_other;
}
if (o == listop)
expr = newUNOP(OP_DEFINED, 0,
newASSIGNOP(0, newDEFSVOP(), 0, expr) );
} else if (expr->op_flags & OPf_KIDS) {
- const OP * const k1 = ((UNOP*)expr)->op_first;
+ const OP * const k1 = cUNOPx(expr)->op_first;
const OP * const k2 = (k1) ? OpSIBLING(k1) : NULL;
switch (expr->op_type) {
case OP_NULL:
return expr; /* listop already freed by new_logop */
}
if (listop)
- ((LISTOP*)listop)->op_last->op_next =
+ cLISTOPx(listop)->op_last->op_next =
(o == listop ? redo : LINKLIST(o));
}
else
else if (sv->op_type == OP_NULL && sv->op_targ == OP_SREFGEN)
NOOP;
else if (sv->op_type == OP_LIST) {
- LISTOP *list = (LISTOP *) sv;
+ LISTOP *list = cLISTOPx(sv);
OP *pushmark = list->op_first;
OP *first_padsv;
UNOP *padsv;
/* There should be at least one more PADSV to find, and the ops
should have consecutive values in targ: */
- padsv = (UNOP *) OpSIBLING(first_padsv);
+ padsv = cUNOPx(OpSIBLING(first_padsv));
do {
if (!padsv || padsv->op_type != OP_PADSV) {
Perl_croak(aTHX_ "panic: newFORLOOP, found %s at %zd, expecting padsv",
how_many_more, padsv->op_targ, padoff + how_many_more);
}
- padsv = (UNOP *) OpSIBLING(padsv);
+ padsv = cUNOPx(OpSIBLING(padsv));
} while (padsv);
/* OK, this optree has the shape that we expected. So now *we*
i = padoff;
- padsv = (UNOP *) OpSIBLING(first_padsv);
+ padsv = cUNOPx(OpSIBLING(first_padsv));
do {
++i;
padsv->op_targ = 0;
PAD_COMPNAME_GEN_set(i, PERL_INT_MAX);
- padsv = (UNOP *) OpSIBLING(padsv);
+ padsv = cUNOPx(OpSIBLING(padsv));
} while (padsv);
op_free(sv);
}
else if (expr->op_type == OP_NULL &&
(expr->op_flags & OPf_KIDS) &&
- ((BINOP*)expr)->op_first->op_type == OP_FLOP)
+ cBINOPx(expr)->op_first->op_type == OP_FLOP)
{
/* Basically turn for($x..$y) into the same as for($x,$y), but we
* set the STACKED flag to indicate that these values are to be
* treated as min/max values by 'pp_enteriter'.
*/
- const UNOP* const flip = (UNOP*)((UNOP*)((BINOP*)expr)->op_first)->op_first;
- LOGOP* const range = (LOGOP*) flip->op_first;
+ const UNOP* const flip = cUNOPx(cUNOPx(cBINOPx(expr)->op_first)->op_first);
+ LOGOP* const range = cLOGOPx(flip->op_first);
OP* const left = range->op_first;
OP* const right = OpSIBLING(left);
LISTOP* listop;
/* detach range's children */
op_sibling_splice((OP*)range, NULL, -1, NULL);
- listop = (LISTOP*)newLISTOP(OP_LIST, 0, left, right);
+ listop = cLISTOPx(newLISTOP(OP_LIST, 0, left, right));
listop->op_first->op_next = range->op_next;
left->op_next = range->op_other;
right->op_next = (OP*)listop;
/* Check for a constant argument */
if (label->op_type == OP_CONST) {
- SV * const sv = ((SVOP *)label)->op_sv;
+ SV * const sv = cSVOPx(label)->op_sv;
STRLEN l;
const char *s = SvPV_const(sv,l);
if (l == strlen(s)) {
o = newPVOP(type,
- SvUTF8(((SVOP*)label)->op_sv),
+ SvUTF8(cSVOPx(label)->op_sv),
savesharedpv(
- SvPV_nolen_const(((SVOP*)label)->op_sv)));
+ SvPV_nolen_const(cSVOPx(label)->op_sv)));
}
}
else if (SvPOK(gv) && *SvPVX((SV *)gv) == '&')
name = newSVpvn_flags(SvPVX((SV *)gv)+1, SvCUR(gv)-1, SvUTF8(gv)|SVs_TEMP);
else if (flags & CV_CKPROTO_CURSTASH || SvROK(gv)) {
- name = sv_2mortal(newSVhek(HvNAME_HEK(PL_curstash)));
+ name = newSVhek_mortal(HvNAME_HEK(PL_curstash));
sv_catpvs(name, "::");
if (SvROK(gv)) {
assert (SvTYPE(SvRV_const(gv)) == SVt_PVCV);
if (proto) {
assert(proto->op_type == OP_CONST);
- ps = SvPV_const(((SVOP*)proto)->op_sv, ps_len);
- ps_utf8 = SvUTF8(((SVOP*)proto)->op_sv);
+ ps = SvPV_const(cSVOPx(proto)->op_sv, ps_len);
+ ps_utf8 = SvUTF8(cSVOPx(proto)->op_sv);
}
else
ps = NULL;
if (proto) {
assert(proto->op_type == OP_CONST);
- ps = SvPV_const(((SVOP*)proto)->op_sv, ps_len);
- ps_utf8 = SvUTF8(((SVOP*)proto)->op_sv);
+ ps = SvPV_const(cSVOPx(proto)->op_sv, ps_len);
+ ps_utf8 = SvUTF8(cSVOPx(proto)->op_sv);
}
else
ps = NULL;
if (!FEATURE_BAREWORD_FILEHANDLES_IS_ENABLED &&
((PL_opargs[type] >> OASHIFT) & 7) == OA_FILEREF &&
o->op_type == OP_CONST && (o->op_private & OPpCONST_BARE)) {
- no_bareword_filehandle(SvPVX(cSVOPx_sv((SVOP*)o)));
+ no_bareword_filehandle(SvPVX(cSVOPo_sv));
}
return ref(newUNOP(OP_RV2GV, OPf_REF, o), type);
PL_hints |= HINT_BLOCK_SCOPE;
if (o->op_flags & OPf_KIDS) {
- SVOP * const kid = (SVOP*)cUNOPo->op_first;
+ SVOP * const kid = cSVOPx(cUNOPo->op_first);
assert(kid);
if (o->op_type == OP_ENTERTRY) {
OP *
Perl_ck_rvconst(pTHX_ OP *o)
{
- SVOP * const kid = (SVOP*)cUNOPo->op_first;
+ SVOP * const kid = cSVOPx(cUNOPo->op_first);
PERL_ARGS_ASSERT_CK_RVCONST;
NOOP;
}
else if (o->op_flags & OPf_KIDS && cUNOPo->op_first->op_type != OP_STUB) {
- SVOP * const kid = (SVOP*)cUNOPo->op_first;
+ SVOP * const kid = cSVOPx(cUNOPo->op_first);
const OPCODE kidtype = kid->op_type;
if (kidtype == OP_CONST && (kid->op_private & OPpCONST_BARE)
&& !kid->op_folded) {
if (!FEATURE_BAREWORD_FILEHANDLES_IS_ENABLED) {
- no_bareword_filehandle(SvPVX(cSVOPx_sv((SVOP*)kid)));
+ no_bareword_filehandle(SvPVX(kSVOP_sv));
}
OP * const newop = newGVOP(type, OPf_REF,
gv_fetchsv(kid->op_sv, GV_ADD, SVt_PVIO));
(kid->op_private & OPpCONST_BARE))
{
OP * const newop = newGVOP(OP_GV, 0,
- gv_fetchsv(((SVOP*)kid)->op_sv, GV_ADD, SVt_PVIO));
+ gv_fetchsv(kSVOP->op_sv, GV_ADD, SVt_PVIO));
/* a first argument is handled by toke.c, ideally we'd
just check here but several ops don't use ck_fun() */
if (!FEATURE_BAREWORD_FILEHANDLES_IS_ENABLED) {
- no_bareword_filehandle(SvPVX(cSVOPx_sv((SVOP*)kid)));
+ no_bareword_filehandle(SvPVX(kSVOP_sv));
}
/* replace kid with newop in chain */
op_sibling_splice(o, prev_kid, 1, newop);
|| kid->op_type == OP_HELEM)
{
OP *firstop;
- OP *op = ((BINOP*)kid)->op_first;
+ OP *op = kBINOP->op_first;
name = NULL;
if (op) {
SV *tmpstr = NULL;
"[]" : "{}";
if (((op->op_type == OP_RV2AV) ||
(op->op_type == OP_RV2HV)) &&
- (firstop = ((UNOP*)op)->op_first) &&
+ (firstop = cUNOPx(op)->op_first) &&
(firstop->op_type == OP_GV)) {
/* packagevar $a[] or $h{} */
GV * const gv = cGVOPx_gv(firstop);
OP *kid = cLISTOPo->op_first;
if (!FEATURE_BAREWORD_FILEHANDLES_IS_ENABLED
&& kid->op_type == OP_CONST && (kid->op_private & OPpCONST_BARE)) {
- no_bareword_filehandle(SvPVX(cSVOPx_sv((SVOP*)kid)));
+ no_bareword_filehandle(SvPVX(kSVOP_sv));
}
if (kid->op_type == OP_RV2GV) kid->op_private |= OPpALLOW_FAKE;
scalar(kid);
if (kid->op_type == OP_CONST && kid->op_private & OPpCONST_BARE
&& !kid->op_folded) {
if (!FEATURE_BAREWORD_FILEHANDLES_IS_ENABLED) {
- no_bareword_filehandle(SvPVX(cSVOPx_sv((SVOP*)kid)));
+ no_bareword_filehandle(SvPVX(kSVOP_sv));
}
o->op_flags |= OPf_STACKED; /* make it a filehandle */
scalar(kid);
(oa = OpSIBLING(first)) && /* The fh. */
(oa = OpSIBLING(oa)) && /* The mode. */
(oa->op_type == OP_CONST) &&
- SvPOK(((SVOP*)oa)->op_sv) &&
- (mode = SvPVX_const(((SVOP*)oa)->op_sv)) &&
+ SvPOK(cSVOPx(oa)->op_sv) &&
+ (mode = SvPVX_const(cSVOPx(oa)->op_sv)) &&
mode[0] == '>' && mode[1] == '&' && /* A dup open. */
(last == OpSIBLING(oa))) /* The bareword. */
last->op_private &= ~OPpCONST_STRICT;
/* a CVREF here confuses pp_refassign, so make sure
it gets a GV */
CV *const cv = (CV*)SvRV(sv);
- SV *name_sv = sv_2mortal(newSVhek(CvNAME_HEK(cv)));
+ SV *name_sv = newSVhek_mortal(CvNAME_HEK(cv));
(void)gv_init_sv((GV*)sv, CvSTASH(cv), name_sv, 0);
assert(SvTYPE(sv) == SVt_PVGV);
}
PERL_ARGS_ASSERT_CK_REQUIRE;
if (o->op_flags & OPf_KIDS) { /* Shall we supply missing .pm? */
- SVOP * const kid = (SVOP*)cUNOPo->op_first;
+ SVOP * const kid = cSVOPx(cUNOPo->op_first);
U32 hash;
char *s;
STRLEN len;
assert(kid->op_type == OP_MATCH || kid->op_type == OP_SPLIT);
- if (((PMOP *)kid)->op_pmflags & PMf_GLOBAL) {
+ if (kPMOP->op_pmflags & PMf_GLOBAL) {
Perl_ck_warner(aTHX_ packWARN(WARN_REGEXP),
"Use of /g modifier is meaningless in split");
}
}
return opnum == OP_RUNCV
- ? newPVOP(OP_RUNCV,0,NULL)
+ ? newSVOP(OP_RUNCV, 0, &PL_sv_undef)
: newOP(opnum,0);
default:
return op_convert_list(opnum,0,aop);
const_class = &cSVOPx(aop)->op_sv;
}
else if (aop->op_type == OP_LIST) {
- OP * const sib = OpSIBLING(((UNOP*)aop)->op_first);
+ OP * const sib = OpSIBLING(cUNOPx(aop)->op_first);
if (sib && sib->op_type == OP_CONST) {
sib->op_private &= ~OPpCONST_STRICT;
const_class = &cSVOPx(sib)->op_sv;
PERL_ARGS_ASSERT_CK_TRUNC;
if (o->op_flags & OPf_KIDS) {
- SVOP *kid = (SVOP*)cUNOPo->op_first;
+ SVOP *kid = cSVOPx(cUNOPo->op_first);
if (kid->op_type == OP_NULL)
- kid = (SVOP*)OpSIBLING(kid);
+ kid = cSVOPx(OpSIBLING(kid));
if (kid && kid->op_type == OP_CONST &&
(kid->op_private & OPpCONST_BARE) &&
!kid->op_folded)