summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2019-12-02 15:50:49 +1100
committerTony Cook <tony@develop-help.com>2019-12-05 10:35:00 +1100
commitb34c1a7ee25272539dd91c7ab2e8161df3ac5fbc (patch)
tree724d3928984eaad370d7f7f863a6a3877e33fe9b /mg.c
parent41fb88e324074a38d858df0dbd2632e5e00753e6 (diff)
downloadperl-b34c1a7ee25272539dd91c7ab2e8161df3ac5fbc.tar.gz
updates to $^H{feature_validname} now update cop_features
This removes $^{FEATURE_BITS}, since it's no longer needed.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mg.c b/mg.c
index e1417741fa..37d734ddd1 100644
--- a/mg.c
+++ b/mg.c
@@ -41,6 +41,7 @@ tie.
#include "EXTERN.h"
#define PERL_IN_MG_C
#include "perl.h"
+#include "feature.h"
#if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS)
# ifdef I_GRP
@@ -1029,9 +1030,6 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
if (nextchar == '\0') {
sv_setiv(sv, (IV)PL_maxsysfd);
}
- else if (strEQ(remaining, "EATURE_BITS")) {
- sv_setuv(sv, PL_compiling.cop_features);
- }
break;
case '\007': /* ^GLOBAL_PHASE */
if (strEQ(remaining, "LOBAL_PHASE")) {
@@ -2886,9 +2884,6 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
if (mg->mg_ptr[1] == '\0') {
PL_maxsysfd = SvIV(sv);
}
- else if (strEQ(mg->mg_ptr + 1, "EATURE_BITS")) {
- PL_compiling.cop_features = SvUV(sv);
- }
break;
case '\010': /* ^H */
{
@@ -3680,6 +3675,7 @@ Perl_magic_sethint(pTHX_ SV *sv, MAGIC *mg)
PL_hints |= HINT_LOCALIZE_HH;
CopHINTHASH_set(&PL_compiling,
cophh_store_sv(CopHINTHASH_get(&PL_compiling), key, 0, sv, 0));
+ magic_sethint_feature(key, NULL, 0, sv, 0);
return 0;
}
@@ -3704,6 +3700,10 @@ Perl_magic_clearhint(pTHX_ SV *sv, MAGIC *mg)
MUTABLE_SV(mg->mg_ptr), 0, 0)
: cophh_delete_pvn(CopHINTHASH_get(&PL_compiling),
mg->mg_ptr, mg->mg_len, 0, 0));
+ if (mg->mg_len == HEf_SVKEY)
+ magic_sethint_feature(MUTABLE_SV(mg->mg_ptr), NULL, 0, NULL, FALSE);
+ else
+ magic_sethint_feature(NULL, mg->mg_ptr, mg->mg_len, NULL, FALSE);
return 0;
}
@@ -3722,6 +3722,7 @@ Perl_magic_clearhints(pTHX_ SV *sv, MAGIC *mg)
PERL_UNUSED_ARG(mg);
cophh_free(CopHINTHASH_get(&PL_compiling));
CopHINTHASH_set(&PL_compiling, cophh_new_empty());
+ CLEARFEATUREBITS();
return 0;
}