summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-04-22 22:32:09 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-05-21 16:51:32 -0700
commite33525913afb6ff03f7a9e1f9881fd5ea6982f22 (patch)
treea1d8a854f5d7f8fc42bd43fb00c827944d0754ab /ext
parent6d77e8c75fe4eeaaa87223507d2214238206bf19 (diff)
downloadperl-e33525913afb6ff03f7a9e1f9881fd5ea6982f22.tar.gz
[perl #111000] Let hv_store work on hint hashes
Magic attached to hash elements has its key stored differently depend- ing on how it was supplied to hv_common. hv_store passes a string/ length pair to hv_common, while hv_store_ent passes an SV. magic_clearhint wasn’t able to handle string/length pairs, and only worked with SVs, resulting in assertion failures or crashes. This commit fixes magic_clearhint, so that XS code can use hv_store on hint hashes.
Diffstat (limited to 'ext')
-rw-r--r--ext/XS-APItest/t/hash.t10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/XS-APItest/t/hash.t b/ext/XS-APItest/t/hash.t
index 0fdd64e7ce..84b6274bdd 100644
--- a/ext/XS-APItest/t/hash.t
+++ b/ext/XS-APItest/t/hash.t
@@ -260,6 +260,16 @@ sub test_precomputed_hashes {
pass 'no crash when writing to hash elem with null value via slice';
}
+# [perl #111000] Bug number eleventy-one thousand:
+# hv_store should work on hint hashes
+eval q{
+ BEGIN {
+ XS::APItest::Hash::store \%^H, "XS::APItest/hash.t", undef;
+ delete $^H{"XS::APItest/hash.t"};
+ }
+};
+pass("hv_store works on the hint hash");
+
done_testing;
exit;