if (isGV_with_GP(sv)) {
if (GvINTRO(sv)) sv_catpv(d, "INTRO,");
if (GvMULTI(sv)) sv_catpv(d, "MULTI,");
- if (GvUNIQUE(sv)) sv_catpv(d, "UNIQUE,");
if (GvASSUMECV(sv)) sv_catpv(d, "ASSUMECV,");
if (GvIN_PAD(sv)) sv_catpv(d, "IN_PAD,");
}
XPUSHs(newSVpvs_flags("lvalue", SVs_TEMP));
if (cvflags & CVf_METHOD)
XPUSHs(newSVpvs_flags("method", SVs_TEMP));
- if (GvUNIQUE(CvGV((const CV *)sv)))
- XPUSHs(newSVpvs_flags("unique", SVs_TEMP));
- break;
- case SVt_PVGV:
- if (isGV_with_GP(sv) && GvUNIQUE(sv))
- XPUSHs(newSVpvs_flags("unique", SVs_TEMP));
break;
default:
break;
}
if (!GvIOp(gv)) {
-#ifdef GV_UNIQUE_CHECK
- if (GvUNIQUE(gv)) {
- Perl_croak(aTHX_ "Bad symbol for filehandle (GV is unique)");
- }
-#endif
GvIOp(gv) = newIO();
}
return gv;
#define GvIN_PAD_on(gv) (GvFLAGS(gv) |= GVf_IN_PAD)
#define GvIN_PAD_off(gv) (GvFLAGS(gv) &= ~GVf_IN_PAD)
-#define GvUNIQUE(gv) 0
-#define GvUNIQUE_on(gv) NOOP
-#define GvUNIQUE_off(gv) NOOP
-
-#ifdef USE_ITHREADS
-#define GV_UNIQUE_CHECK
-#else
-#undef GV_UNIQUE_CHECK
-#endif
-
#ifndef PERL_CORE
# define Nullgv Null(GV*)
#endif
cv = (!name || GvCVGEN(gv)) ? NULL : GvCV(gv);
-#ifdef GV_UNIQUE_CHECK
- if (cv && GvUNIQUE(gv) && SvREADONLY(cv)) {
- Perl_croak(aTHX_ "Can't define subroutine %s (GV is unique)", name);
- }
-#endif
-
if (!block || !ps || *ps || attrs
|| (CvFLAGS(PL_compcv) & CVf_BUILTIN_ATTRS)
#ifdef PERL_MAD
if (cv) {
const bool exists = CvROOT(cv) || CvXSUB(cv);
-#ifdef GV_UNIQUE_CHECK
- if (exists && GvUNIQUE(gv)) {
- Perl_croak(aTHX_ "Can't redefine unique subroutine %s", name);
- }
-#endif
-
/* if the subroutine doesn't exist and wasn't pre-declared
* with a prototype, assume it will be AUTOLOADed,
* skipping the prototype check
? gv_fetchsv(cSVOPo->op_sv, GV_ADD, SVt_PVFM)
: gv_fetchpvs("STDOUT", GV_ADD|GV_NOTQUAL, SVt_PVFM);
-#ifdef GV_UNIQUE_CHECK
- if (GvUNIQUE(gv)) {
- Perl_croak(aTHX_ "Bad symbol for form (GV is unique)");
- }
-#endif
GvMULTI_on(gv);
if ((cv = GvFORM(gv))) {
if (ckWARN(WARN_REDEFINE)) {
break;
case SVt_PVGV:
if (isGV_with_GP(varsv)) {
-#ifdef GV_UNIQUE_CHECK
- if (GvUNIQUE((const GV *)varsv)) {
- Perl_croak(aTHX_ "Attempt to tie unique GV");
- }
-#endif
methname = "TIEHANDLE";
how = PERL_MAGIC_tiedscalar;
/* For tied filehandles, we apply tiedscalar magic to the IO
SvFAKE_on(dstr); /* can coerce to non-glob */
}
-#ifdef GV_UNIQUE_CHECK
- if (GvUNIQUE((const GV *)dstr)) {
- Perl_croak(aTHX_ "%s", PL_no_modify);
- }
-#endif
-
if(GvGP(MUTABLE_GV(sstr))) {
/* If source has method cache entry, clear it */
if(GvCVGEN(sstr)) {
PERL_ARGS_ASSERT_GLOB_ASSIGN_REF;
-#ifdef GV_UNIQUE_CHECK
- if (GvUNIQUE((const GV *)dstr)) {
- Perl_croak(aTHX_ "%s", PL_no_modify);
- }
-#endif
-
if (intro) {
GvINTRO_off(dstr); /* one-shot flag */
GvLINE(dstr) = CopLINE(PL_curcop);
break;
case SVt_PVGV:
- if (GvUNIQUE((const GV *)sstr)) {
- NOOP; /* Do sharing here, and fall through */
- }
case SVt_PVIO:
case SVt_PVFM:
case SVt_PVHV:
CvROOT(dstr) = OpREFCNT_inc(CvROOT(dstr));
OP_REFCNT_UNLOCK;
if (CvCONST(dstr) && CvISXSUB(dstr)) {
- CvXSUBANY(dstr).any_ptr = GvUNIQUE(CvGV(dstr)) ?
- SvREFCNT_inc(CvXSUBANY(dstr).any_ptr) :
+ CvXSUBANY(dstr).any_ptr =
sv_dup_inc((const SV *)CvXSUBANY(dstr).any_ptr, param);
}
/* don't dup if copying back - CvGV isn't refcounted, so the
if (len == 6 && strnEQ(SvPVX(sv), "unique", len)) {
sv_free(sv);
if (PL_in_my == KEY_our) {
-#ifdef USE_ITHREADS
- GvUNIQUE_on(cGVOPx_gv(pl_yylval.opval));
-#else
- /* skip to avoid loading attributes.pm */
-#endif
deprecate(":unique");
}
else