Permalink
Browse files

On Perl 5.17.6 and above, hash seeding has changed, and HvREHASH has …

…disappeared.

Patch to update mod_perl accordingly from rt.cpan.org #83921. [Zefram]

git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/trunk@1457618 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 9e0aa18 commit 466c39f9d9ea1754301c66b87358be47f753751c Steve Hay committed Mar 18, 2013
Showing with 13 additions and 4 deletions.
  1. +4 −0 Changes
  2. +8 −3 src/modules/perl/modperl_perl.c
  3. +1 −1 t/perl/hash_attack.t
View
@@ -12,6 +12,10 @@ Also refer to the Apache::Test changes log file, at Apache-Test/Changes
=item 2.0.8-dev
+On Perl 5.17.6 and above, hash seeding has changed, and HvREHASH has
+disappeared. Patch to update mod_perl accordingly from rt.cpan.org #83921.
+[Zefram]
+
Restore build with Perl 5.8.1, 5.8.2 etc: take care to use
$Config{useithreads} rather than $Config{usethreads}, and supply definitions
of Newx and Newxz as necessary. [Steve Hay]
@@ -265,12 +265,17 @@ void modperl_hash_seed_set(pTHX)
{
#ifdef MP_NEED_HASH_SEED_FIXUP
if (MP_init_hash_seed_set) {
-#if MP_PERL_VERSION(5, 8, 1)
- PL_hash_seed = MP_init_hash_seed;
+#if MP_PERL_VERSION_AT_LEAST(5, 17, 6)
+ memcpy(&PL_hash_seed, &MP_init_hash_seed,
+ sizeof(PL_hash_seed) > sizeof(MP_init_hash_seed) ?
+ sizeof(MP_init_hash_seed) : sizeof(PL_hash_seed));
PL_hash_seed_set = MP_init_hash_seed_set;
-#else
+#elif MP_PERL_VERSION_AT_LEAST(5, 8, 2)
PL_rehash_seed = MP_init_hash_seed;
PL_rehash_seed_set = MP_init_hash_seed_set;
+#else
+ PL_hash_seed = MP_init_hash_seed;
+ PL_hash_seed_set = MP_init_hash_seed_set;
#endif
}
#endif
View
@@ -8,7 +8,7 @@ use Apache::TestTrace;
use Apache::TestRequest 'GET_BODY_ASSERT';
plan tests => 1,
- need { "relevant only for perl 5.8.2 and higher" => ($] >= 5.008002) };
+ need { "relevant only for perl 5.8.2 and up to 5.17.6" => ($] >= 5.008002 && $] < 5.017006) };
my $expected = "ok";
my $received = GET_BODY_ASSERT "/TestPerl__hash_attack";

0 comments on commit 466c39f

Please sign in to comment.