X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/dca6062a863d0e957d067cc75f9e13b2e28b1090..012da8e581e60270322b8deba22fdfab9df5db1b:/op.c diff --git a/op.c b/op.c index 3997fac..11b29d8 100644 --- a/op.c +++ b/op.c @@ -4380,20 +4380,14 @@ Perl_newSTATEOP(pTHX_ I32 flags, char *label, OP *o) HINTS_REFCNT_UNLOCK; } if (label) { - /* Proof of concept for now - for efficiency reasons these are likely - to end up being replaced by a custom function in hv.c */ - SV *const key = newSVpvs(":"); - SV *const value = newSVpv(label, 0); cop->cop_hints_hash - = Perl_refcounted_he_new(aTHX_ cop->cop_hints_hash, key, value); + = Perl_store_cop_label(aTHX_ cop->cop_hints_hash, label); PL_hints |= HINT_BLOCK_SCOPE; /* It seems that we need to defer freeing this pointer, as other parts of the grammar end up wanting to copy it after this op has been created. */ SAVEFREEPV(label); - SvREFCNT_dec(key); - SvREFCNT_dec(value); } if (PL_parser && PL_parser->copline == NOLINE)