diff options
author | Father Chrysostomos <sprout@cpan.org> | 2015-03-27 09:23:41 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2015-03-27 12:30:22 -0700 |
commit | 71622e40793536aa4f2ace7ffc704cc78151fd26 (patch) | |
tree | 0c96ea53aeab1fdec2e092a1bc5c8df477b54a83 /hv.c | |
parent | d1d50e3e86916d266355a8fe5c5374460f7aa033 (diff) | |
download | perl-71622e40793536aa4f2ace7ffc704cc78151fd26.tar.gz |
Stop $^H |= 0x1c020000 from enabling all features
That set of bits sets the feature bundle to ‘custom’, which means that
the features are set by %^H, and also indicates that %^H has been did-
dled with, so it’s worth looking at.
In the specific case where %^H is untouched and there is no corres-
ponding cop hint hash behind the scenes, Perl_feature_is_enabled (in
toke.c) ends up returning TRUE.
Commit v5.15.6-55-g94250ae sped up feature checking by allowing
refcounted_he_fetch to return a boolean when checking for existence,
instead of converting the value to a scalar, whose contents we are not
even going to use.
This was when the bug started happening. I did not update the code
path in refcounted_he_fetch that handles the absence of a hint hash.
So it was returning &PL_sv_placeholder instead of NULL; TRUE instead
of FALSE.
This did not cause problems for most code, but with the introduction
of the new bitwise ops in v5.21.8-150-g8823cb8, it started causing
uni::perl to fail, because they were implicitly enabled, making ^ a
numeric op, when it was being used as a string op.
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3189,7 +3189,7 @@ Perl_refcounted_he_fetch_pvn(pTHX_ const struct refcounted_he *chain, Perl_croak(aTHX_ "panic: refcounted_he_fetch_pvn bad flags %"UVxf, (UV)flags); if (!chain) - return &PL_sv_placeholder; + goto ret; if (flags & REFCOUNTED_HE_KEY_UTF8) { /* For searching purposes, canonicalise to Latin-1 where possible. */ const char *keyend = keypv + keylen, *p; @@ -3249,6 +3249,7 @@ Perl_refcounted_he_fetch_pvn(pTHX_ const struct refcounted_he *chain, return sv_2mortal(refcounted_he_value(chain)); } } + ret: return flags & REFCOUNTED_HE_EXISTS ? NULL : &PL_sv_placeholder; } |