static const char file[] = __FILE__;
CV *cv, *oldcompcv = NULL;
int opnum = 0;
- SV *opnumsv;
bool ampable = TRUE; /* &{}-able */
COP *oldcurcop = NULL;
yy_parser *oldparser = NULL;
if (stash)
(void)hv_store(stash,name,len,(SV *)gv,0);
if (ampable) {
+#ifdef DEBUGGING
+ CV *orig_cv = cv;
+#endif
CvLVALUE_on(cv);
- newATTRSUB_flags(
+ /* newATTRSUB will free the CV and return NULL if we're still
+ compiling after a syntax error */
+ if ((cv = newATTRSUB_flags(
oldsavestack_ix, (OP *)gv,
NULL,NULL,
coresub_op(
code, opnum
),
1
- );
- assert(GvCV(gv) == cv);
- if (opnum != OP_VEC && opnum != OP_SUBSTR && opnum != OP_POS
- && opnum != OP_UNDEF)
- CvLVALUE_off(cv); /* Now *that* was a neat trick. */
+ )) != NULL) {
+ assert(GvCV(gv) == orig_cv);
+ if (opnum != OP_VEC && opnum != OP_SUBSTR && opnum != OP_POS
+ && opnum != OP_UNDEF)
+ CvLVALUE_off(cv); /* Now *that* was a neat trick. */
+ }
LEAVE;
PL_parser = oldparser;
PL_curcop = oldcurcop;
PL_compcv = oldcompcv;
}
- opnumsv = opnum ? newSVuv((UV)opnum) : (SV *)NULL;
- cv_set_call_checker(
- cv, Perl_ck_entersub_args_core, opnumsv ? opnumsv : (SV *)cv
- );
- SvREFCNT_dec(opnumsv);
+ if (cv) {
+ SV *opnumsv = opnum ? newSVuv((UV)opnum) : (SV *)NULL;
+ cv_set_call_checker(
+ cv, Perl_ck_entersub_args_core, opnumsv ? opnumsv : (SV *)cv
+ );
+ SvREFCNT_dec(opnumsv);
+ }
+
return gv;
}
: ""), SVfARG(namesv));
GV *gv;
SvREFCNT_dec_NN(namesv);
- if (USE_UTF8_IN_NAMES)
+ if (is_utf8)
SvUTF8_on(err);
qerror(err);
gv = gv_fetchpvs("<none>::", GV_ADDMULTI, SVt_PVHV);
if (add) {
GvMULTI_on(gv);
gv_init_svtype(gv, sv_type);
+ /* You reach this path once the typeglob has already been created,
+ either by the same or a different sigil. If this path didn't
+ exist, then (say) referencing $! first, and %! second would
+ mean that %! was not handled correctly. */
if (len == 1 && stash == PL_defstash) {
if (sv_type == SVt_PVHV || sv_type == SVt_PVGV) {
if (*name == '!')
require_tie_mod(gv, "!", newSVpvs("Errno"), "TIEHASH", 1);
else if (*name == '-' || *name == '+')
require_tie_mod(gv, name, newSVpvs("Tie::Hash::NamedCapture"), "TIEHASH", 0);
- }
+ } else if (sv_type == SVt_PV) {
+ if (*name == '*' || *name == '#') {
+ /* diag_listed_as: $* is no longer supported */
+ Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED,
+ WARN_SYNTAX),
+ "$%c is no longer supported", *name);
+ }
+ }
if (sv_type==SVt_PV || sv_type==SVt_PVGV) {
switch (*name) {
case '[':
&& (cvp = (AMT_AMAGIC((AMT*)mg->mg_ptr)
? (amtp = (AMT*)mg->mg_ptr)->table
: NULL))
- && ((cv = cvp[off=method+assignshift])
- || (assign && amtp->fallback > AMGfallNEVER && /* fallback to
- * usual method */
- (
-#ifdef DEBUGGING
- fl = 1,
-#endif
- cv = cvp[off=method])))) { /* Method for right
- * argument found */
- lr=1;
+ && (cv = cvp[off=method])) { /* Method for right
+ * argument found */
+ lr=1;
} else if (((cvp && amtp->fallback > AMGfallNEVER)
|| (ocvp && oamtp->fallback > AMGfallNEVER))
&& !(flags & AMGf_unary)) {