pp_or, and pp_defined, respectively.
p4raw-id: //depot/perl@26007
return pp_defined();
}
+PP(pp_andassign)
+{
+ return pp_and();
+}
+
+PP(pp_orassign)
+{
+ return pp_or();
+}
+
+PP(pp_dorassign)
+{
+ return pp_defined();
+}
+
U8 *
Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv)
{
MEMBER_TO_FPTR(Perl_pp_range),
MEMBER_TO_FPTR(Perl_pp_flip),
MEMBER_TO_FPTR(Perl_pp_flop),
- MEMBER_TO_FPTR(Perl_pp_and),
- MEMBER_TO_FPTR(Perl_pp_or),
+ MEMBER_TO_FPTR(Perl_pp_and), /* Perl_pp_and */
+ MEMBER_TO_FPTR(Perl_pp_or), /* Perl_pp_or */
MEMBER_TO_FPTR(Perl_pp_xor),
MEMBER_TO_FPTR(Perl_pp_cond_expr),
MEMBER_TO_FPTR(Perl_pp_andassign),
MEMBER_TO_FPTR(Perl_pp_setstate),
MEMBER_TO_FPTR(Perl_pp_method_named),
MEMBER_TO_FPTR(Perl_pp_defined), /* Perl_pp_dor */
- MEMBER_TO_FPTR(Perl_pp_dorassign),
+ MEMBER_TO_FPTR(Perl_pp_defined), /* Perl_pp_dorassign */
}
#endif
;
fteexec)],
Perl_pp_shmwrite => [qw(shmread msgsnd msgrcv semop)],
Perl_pp_send => ['syswrite'],
- Perl_pp_defined => ['dor'],
+ Perl_pp_defined => [qw(dor dorassign)],
+ Perl_pp_and => ['and'],
+ Perl_pp_or => ['or'],
);
while (my ($func, $names) = splice @raw_alias, 0, 2) {
RETSETNO;
}
-PP(pp_andassign)
-{
- dSP;
- if (!SvTRUE(TOPs))
- RETURN;
- else
- RETURNOP(cLOGOP->op_other);
-}
-
-PP(pp_orassign)
-{
- dSP;
- if (SvTRUE(TOPs))
- RETURN;
- else
- RETURNOP(cLOGOP->op_other);
-}
-
-PP(pp_dorassign)
-{
- dSP;
- register SV* sv;
-
- sv = TOPs;
- if (!sv || !SvANY(sv)) {
- RETURNOP(cLOGOP->op_other);
- }
-
- switch (SvTYPE(sv)) {
- case SVt_PVAV:
- if (AvMAX(sv) >= 0 || SvGMAGICAL(sv) || (SvRMAGICAL(sv) && mg_find(sv, PERL_MAGIC_tied)))
- RETURN;
- break;
- case SVt_PVHV:
- if (HvARRAY(sv) || SvGMAGICAL(sv) || (SvRMAGICAL(sv) && mg_find(sv, PERL_MAGIC_tied)))
- RETURN;
- break;
- case SVt_PVCV:
- if (CvROOT(sv) || CvXSUB(sv))
- RETURN;
- break;
- default:
- SvGETMAGIC(sv);
- if (SvOK(sv))
- RETURN;
- }
-
- RETURNOP(cLOGOP->op_other);
-}
-
PP(pp_caller)
{
dSP;
if (!SvTRUE(TOPs))
RETURN;
else {
- --SP;
+ if (PL_op->op_type == OP_AND)
+ --SP;
RETURNOP(cLOGOP->op_other);
}
}
if (SvTRUE(TOPs))
RETURN;
else {
- --SP;
+ if (PL_op->op_type == OP_OR)
+ --SP;
RETURNOP(cLOGOP->op_other);
}
}
bool defined = FALSE;
const int op_type = PL_op->op_type;
- if(op_type == OP_DOR) {
+ if(op_type == OP_DOR || op_type == OP_DORASSIGN) {
sv = TOPs;
if (!sv || !SvANY(sv)) {
--SP;
defined = TRUE;
}
- if(defined) {
- if(op_type == OP_DOR)
- RETURN;
- else if (op_type == OP_DEFINED)
- RETPUSHYES;
- }
-
- if(op_type == OP_DOR) {
- --SP;
+ if(op_type == OP_DOR || op_type == OP_DORASSIGN) {
+ if(defined)
+ RETURN;
+ if(op_type == OP_DOR)
+ --SP;
RETURNOP(cLOGOP->op_other);
} else if (op_type == OP_DEFINED) {
+ if(defined)
+ RETPUSHYES;
RETPUSHNO;
}
}