}
STATIC bool
-S_is_handle_constructor(pTHX_ const OP *o, I32 argnum)
+S_is_handle_constructor(pTHX_ const OP *o, I32 numargs)
{
switch (o->op_type) {
case OP_PIPE_OP:
case OP_SOCKPAIR:
- if (argnum == 2)
+ if (numargs == 2)
return TRUE;
/* FALL THROUGH */
case OP_SYSOPEN:
case OP_SOCKET:
case OP_OPEN_DIR:
case OP_ACCEPT:
- if (argnum == 1)
+ if (numargs == 1)
return TRUE;
/* FALL THROUGH */
default:
ENTER; /* need to protect against side-effects of 'use' */
SAVEINT(PL_expect);
if (stash)
- stashsv = newSVpv(HvNAME_get(stash), 0);
+ stashsv = newSVpvn(HvNAME_get(stash), HvNAMELEN_get(stash));
else
stashsv = &PL_sv_no;
#define ATTRSMODULE_PM "attributes.pm"
if (for_my) {
- SV **svp;
/* Don't force the C<use> if we don't need it. */
- svp = hv_fetch(GvHVn(PL_incgv), ATTRSMODULE_PM,
+ SV **svp = hv_fetch(GvHVn(PL_incgv), ATTRSMODULE_PM,
sizeof(ATTRSMODULE_PM)-1, 0);
if (svp && *svp != &PL_sv_undef)
; /* already in %INC */
/* Build up the real arg-list. */
if (stash)
- stashsv = newSVpv(HvNAME_get(stash), 0);
+ stashsv = newSVpvn(HvNAME_get(stash), HvNAMELEN_get(stash));
else
stashsv = &PL_sv_no;
arg = newOP(OP_PADSV, 0);
}
STATIC I32
-S_list_assignment(pTHX_ register const OP *o)
+S_is_list_assignment(pTHX_ register const OP *o)
{
if (!o)
return TRUE;
o = cUNOPo->op_first;
if (o->op_type == OP_COND_EXPR) {
- const I32 t = list_assignment(cLOGOPo->op_first->op_sibling);
- const I32 f = list_assignment(cLOGOPo->op_first->op_sibling->op_sibling);
+ const I32 t = is_list_assignment(cLOGOPo->op_first->op_sibling);
+ const I32 f = is_list_assignment(cLOGOPo->op_first->op_sibling->op_sibling);
if (t && f)
return TRUE;
}
}
- if (list_assignment(left)) {
+ if (is_list_assignment(left)) {
OP *curop;
PL_modcount = 0;
}
else if (CvROOT(cv) || CvXSUB(cv) || GvASSUMECV(gv)) {
/* already defined (or promised) */
+ /* XXX It's possible for this HvNAME_get to return null, and get passed into strEQ */
if (ckWARN(WARN_REDEFINE) && !(CvGV(cv) && GvSTASH(CvGV(cv))
&& strEQ(HvNAME_get(GvSTASH(CvGV(cv))), "autouse"))) {
const line_t oldline = CopLINE(PL_curcop);
|| o->op_type == OP_BIT_AND
|| o->op_type == OP_BIT_XOR))
{
- const OP * left = cBINOPo->op_first;
- const OP * right = left->op_sibling;
+ const OP * const left = cBINOPo->op_first;
+ const OP * const right = left->op_sibling;
if ((OP_IS_NUMCOMPARE(left->op_type) &&
(left->op_flags & OPf_PARENS) == 0) ||
(OP_IS_NUMCOMPARE(right->op_type) &&
return o;
}
-#if 0
-OP *
-Perl_ck_gvconst(pTHX_ register OP *o)
-{
- o = fold_constants(o);
- if (o->op_type == OP_CONST)
- o->op_type = OP_GV;
- return o;
-}
-#endif
-
OP *
Perl_ck_rvconst(pTHX_ register OP *o)
{
if (kid->op_type == OP_CONST) {
int iscv;
GV *gv;
- SV *kidsv = kid->op_sv;
+ SV * const kidsv = kid->op_sv;
/* Is it a constant from cv_const_sv()? */
if (SvROK(kidsv) && SvREADONLY(kidsv)) {
SV *rsv = SvRV(kidsv);
- int svtype = SvTYPE(rsv);
+ const int svtype = SvTYPE(rsv);
const char *badtype = Nullch;
switch (o->op_type) {