SAVETMPS ; \
SAVEINT(db->filtering) ; \
db->filtering = TRUE ; \
- SAVESPTR(DEFSV) ; \
+ SAVE_DEFSV ; \
if (name[7] == 's') \
arg = newSVsv(arg); \
- DEFSV = arg ; \
+ DEFSV_set(arg) ; \
SvTEMP_off(arg) ; \
PUSHMARK(SP) ; \
PUTBACK ; \
@ISA = qw(Exporter DynaLoader);
@EXPORT = qw( filter_add filter_del filter_read filter_read_exact) ;
-$VERSION = "1.07_01" ;
+$VERSION = "1.07_02" ;
sub filter_read_exact($)
{
SAVEINT(current_idx) ; /* save current idx */
current_idx = idx ;
- SAVESPTR(DEFSV) ; /* save $_ */
+ SAVE_DEFSV ; /* save $_ */
/* make $_ use our buffer */
- DEFSV = newSVpv("", 0) ;
+ DEFSV_set(newSVpv("", 0)) ;
PUSHMARK(sp) ;
#endif
#define ERRSV GvSV(PL_errgv)
-/* FIXME? Change the assignments to PL_defgv to instantiate GvSV? */
-#define DEFSV GvSVn(PL_defgv)
+#ifdef PERL_CORE
+# define DEFSV (0 + GvSVn(PL_defgv))
+#else
+# define DEFSV GvSVn(PL_defgv)
+#endif
+#define DEFSV_set(sv) (GvSV(PL_defgv) = (sv))
#define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
#define ERRHV GvHV(PL_errgv) /* XXX unused, here for compatibility */
if (PL_op->op_private & OPpGREP_LEX)
PAD_SVl(PL_op->op_targ) = src;
else
- DEFSV = src;
+ DEFSV_set(src);
PUTBACK;
if (PL_op->op_type == OP_MAPSTART)
if (PL_op->op_private & OPpGREP_LEX)
PAD_SVl(PL_op->op_targ) = src;
else
- DEFSV = src;
+ DEFSV_set(src);
RETURNOP(cLOGOP->op_other);
}
SAVETMPS;
EXTEND(SP, 2);
- DEFSV = upstream;
+ DEFSV_set(upstream);
PUSHMARK(SP);
mPUSHi(0);
if (filter_state) {
if (PL_op->op_private & OPpGREP_LEX)
PAD_SVl(PL_op->op_targ) = src;
else
- DEFSV = src;
+ DEFSV_set(src);
RETURNOP(cLOGOP->op_other);
}
/* Make $_ available to executed code. */
if (reginfo->sv != DEFSV) {
SAVE_DEFSV;
- DEFSV = reginfo->sv;
+ DEFSV_set(reginfo->sv);
}
if (!(SvTYPE(reginfo->sv) >= SVt_PVMG && SvMAGIC(reginfo->sv)