#define hv_magic_check S_hv_magic_check
#define unshare_hek_or_pvn S_unshare_hek_or_pvn
#define share_hek_flags S_share_hek_flags
-#define hv_magic_uvar_xkey S_hv_magic_uvar_xkey
#define hv_notallowed S_hv_notallowed
#define hv_auxinit S_hv_auxinit
#define hv_delete_common S_hv_delete_common
#define hv_magic_check S_hv_magic_check
#define unshare_hek_or_pvn(a,b,c,d) S_unshare_hek_or_pvn(aTHX_ a,b,c,d)
#define share_hek_flags(a,b,c,d) S_share_hek_flags(aTHX_ a,b,c,d)
-#define hv_magic_uvar_xkey(a,b,c,d,e,f) S_hv_magic_uvar_xkey(aTHX_ a,b,c,d,e,f)
#define hv_notallowed(a,b,c,d) S_hv_notallowed(aTHX_ a,b,c,d)
#define hv_auxinit S_hv_auxinit
#define hv_delete_common(a,b,c,d,e,f,g) S_hv_delete_common(aTHX_ a,b,c,d,e,f,g)
return NULL;
if (SvSMAGICAL(hv) && SvGMAGICAL(hv) && !(action & HV_DISABLE_UVAR_XKEY)) {
- keysv = hv_magic_uvar_xkey(hv, keysv, key, klen, flags, action);
- /* If a fetch-as-store fails on the fetch, then the action is to
- recurse once into "hv_store". If we didn't do this, then that
- recursive call would call the key conversion routine again.
- However, as we replace the original key with the converted
- key, this would result in a double conversion, which would show
- up as a bug if the conversion routine is not idempotent. */
- hash = 0;
+ MAGIC* mg;
+ if ((mg = mg_find((SV*)hv, PERL_MAGIC_uvar))) {
+ struct ufuncs * const uf = (struct ufuncs *)mg->mg_ptr;
+ if (uf->uf_set == NULL) {
+ SV* obj = mg->mg_obj;
+
+ if (!keysv) {
+ keysv = sv_2mortal(newSVpvn(key, klen));
+ if (flags & HVhek_UTF8)
+ SvUTF8_on(keysv);
+ }
+
+ mg->mg_obj = keysv; /* pass key */
+ uf->uf_index = action; /* pass action */
+ magic_getuvar((SV*)hv, mg);
+ keysv = mg->mg_obj; /* may have changed */
+ mg->mg_obj = obj;
+
+ /* If the key may have changed, then we need to invalidate
+ any passed-in computed hash value. */
+ hash = 0;
+ }
+ }
}
if (keysv) {
if (flags & HVhek_FREEKEY)
which in turn might do some tied magic. So we need to make that
magic check happen. */
/* gonna assign to this, so it better be there */
+ /* If a fetch-as-store fails on the fetch, then the action is to
+ recurse once into "hv_store". If we didn't do this, then that
+ recursive call would call the key conversion routine again.
+ However, as we replace the original key with the converted
+ key, this would result in a double conversion, which would show
+ up as a bug if the conversion routine is not idempotent. */
return hv_fetch_common(hv, keysv, key, klen, flags,
HV_FETCH_ISSTORE|HV_DISABLE_UVAR_XKEY, val,
hash);
return HeKEY_hek(entry);
}
-STATIC SV *
-S_hv_magic_uvar_xkey(pTHX_ HV* hv, SV* keysv, const char *const key,
- const STRLEN klen, const int k_flags, int action)
-{
- MAGIC* mg;
- if ((mg = mg_find((SV*)hv, PERL_MAGIC_uvar))) {
- struct ufuncs * const uf = (struct ufuncs *)mg->mg_ptr;
- if (uf->uf_set == NULL) {
- SV* obj = mg->mg_obj;
-
- if (!keysv) {
- keysv = sv_2mortal(newSVpvn(key, klen));
- if (k_flags & HVhek_UTF8)
- SvUTF8_on(keysv);
- }
-
- mg->mg_obj = keysv; /* pass key */
- uf->uf_index = action; /* pass action */
- magic_getuvar((SV*)hv, mg);
- keysv = mg->mg_obj; /* may have changed */
- mg->mg_obj = obj;
- }
- }
- return keysv;
-}
-
I32 *
Perl_hv_placeholders_p(pTHX_ HV *hv)
{
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
-STATIC SV* S_hv_magic_uvar_xkey(pTHX_ HV* hv, SV* keysv, const char *const key, const STRLEN klen, const int k_flags, int action)
- __attribute__warn_unused_result__
- __attribute__nonnull__(pTHX_1);
-
STATIC void S_hv_notallowed(pTHX_ int flags, const char *key, I32 klen, const char *msg)
__attribute__noreturn__
__attribute__nonnull__(pTHX_2)