In perl.git, the branch smueller/hash_vtable has been updated <http://perl5.git.perl.org/perl.git/commitdiff/bc0beb4372fab559d95e7a0f71fa87e717cd5064?hp=bcdd01ed148704df11a4ae9a9d8b6a50052547ad>
- Log ----------------------------------------------------------------- commit bc0beb4372fab559d95e7a0f71fa87e717cd5064 Author: Steffen Mueller <[email protected]> Date: Fri Feb 3 17:28:27 2017 +0100 Hash vtables: Fix SAVEPPTR for stores This leaves just the non-SV branch of the fetch hook which is buggy. Seem comment in code. Fix entirely unobvious as of now. M hv_vtbl.c commit ef0eb50d59580876b1e2c731272bebeee0c362ec Author: Steffen Mueller <[email protected]> Date: Fri Feb 3 17:07:32 2017 +0100 Hash vtables: Fix SAVEPPTR call for fetch_ent, note problem for fetch M hv_vtbl.c ----------------------------------------------------------------------- Summary of changes: hv_vtbl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hv_vtbl.c b/hv_vtbl.c index 8f8068b005..cac97c222b 100644 --- a/hv_vtbl.c +++ b/hv_vtbl.c @@ -112,6 +112,9 @@ S_hv_mock_std_vtable_fetch(pTHX_ HV *hv, SV *keysv, const char *key, NULL, hash); } else { + /* FIXME if we fix the SAVEPPTR call above to do the right thing, we get segfaults + * by running ./perl -Dr -e 'my $x = qr/(?{1})/; "a" =~ /a$_/ for $x, $x, $x;' + * which is run by t/re/recompile.t. Complete mystery as of now. */ /* reverse what hv_common_key_len does before calling hv_common... sigh */ I32 my_klen = (key_flags & HVhek_UTF8) ? -(I32)klen : (I32)klen; retval = (SV **)hv_common_key_len(hv, key, my_klen, @@ -141,14 +144,13 @@ S_hv_mock_std_vtable_fetch_ent(pTHX_ HV *hv, SV *keysv, const char *key, /* THIS IS PURELY FOR TESTING! */ HE *retval; XPVHV* xhv = (XPVHV *)SvANY(hv); - HV_VTBL *vtable = xhv->xhv_vtbl; /* Assert that this is the only flags we're getting */ assert((fetch_flags & ~(HV_FETCH_LVALUE|HV_FETCH_EMPTY_HE) ) == 0); ENTER; /* localize vtable such that hv_common takes the normal code path */ - SAVEPPTR(vtable); + SAVEPPTR(xhv->xhv_vtbl); xhv->xhv_vtbl = NULL; retval = (HE *)hv_common(hv, keysv, key, klen, key_flags, @@ -167,11 +169,10 @@ S_hv_mock_std_vtable_store(pTHX_ HV *hv, SV *keysv, /* THIS IS PURELY FOR TESTING! */ SV **retval; XPVHV* xhv = (XPVHV *)SvANY(hv); - HV_VTBL *vtable = xhv->xhv_vtbl; ENTER; /* localize vtable such that hv_common takes the normal code path */ - SAVEPPTR(vtable); + SAVEPPTR(xhv->xhv_vtbl); xhv->xhv_vtbl = NULL; { @@ -202,11 +203,10 @@ S_hv_mock_std_vtable_store_ent(pTHX_ HV *hv, SV *keysv, /* THIS IS PURELY FOR TESTING! */ HE *retval; XPVHV* xhv = (XPVHV *)SvANY(hv); - HV_VTBL *vtable = xhv->xhv_vtbl; ENTER; /* localize vtable such that hv_common takes the normal code path */ - SAVEPPTR(vtable); + SAVEPPTR(xhv->xhv_vtbl); xhv->xhv_vtbl = NULL; retval = (HE *)hv_common(hv, keysv, key, klen, key_flags, -- Perl5 Master Repository
