Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 466c39f9d9ea1754301c66b87358be47f753751c 1 parent 9e0aa18
authored March 18, 2013
4  Changes
@@ -12,6 +12,10 @@ Also refer to the Apache::Test changes log file, at Apache-Test/Changes
12 12
 
13 13
 =item 2.0.8-dev
14 14
 
  15
+On Perl 5.17.6 and above, hash seeding has changed, and HvREHASH has
  16
+disappeared. Patch to update mod_perl accordingly from rt.cpan.org #83921.
  17
+[Zefram]
  18
+
15 19
 Restore build with Perl 5.8.1, 5.8.2 etc: take care to use
16 20
 $Config{useithreads} rather than $Config{usethreads}, and supply definitions
17 21
 of Newx and Newxz as necessary. [Steve Hay]
11  src/modules/perl/modperl_perl.c
@@ -265,12 +265,17 @@ void modperl_hash_seed_set(pTHX)
265 265
 {
266 266
 #ifdef MP_NEED_HASH_SEED_FIXUP
267 267
     if (MP_init_hash_seed_set) {
268  
-#if MP_PERL_VERSION(5, 8, 1)
269  
-        PL_hash_seed       = MP_init_hash_seed;
  268
+#if MP_PERL_VERSION_AT_LEAST(5, 17, 6)
  269
+        memcpy(&PL_hash_seed, &MP_init_hash_seed,
  270
+                sizeof(PL_hash_seed) > sizeof(MP_init_hash_seed) ?
  271
+                    sizeof(MP_init_hash_seed) : sizeof(PL_hash_seed));
270 272
         PL_hash_seed_set   = MP_init_hash_seed_set;
271  
-#else
  273
+#elif MP_PERL_VERSION_AT_LEAST(5, 8, 2)
272 274
         PL_rehash_seed     = MP_init_hash_seed;
273 275
         PL_rehash_seed_set = MP_init_hash_seed_set;
  276
+#else
  277
+        PL_hash_seed       = MP_init_hash_seed;
  278
+        PL_hash_seed_set   = MP_init_hash_seed_set;
274 279
 #endif
275 280
     }
276 281
 #endif
2  t/perl/hash_attack.t
@@ -8,7 +8,7 @@ use Apache::TestTrace;
8 8
 use Apache::TestRequest 'GET_BODY_ASSERT';
9 9
 
10 10
 plan tests => 1,
11  
-    need { "relevant only for perl 5.8.2 and higher" => ($] >= 5.008002) };
  11
+    need { "relevant only for perl 5.8.2 and up to 5.17.6" => ($] >= 5.008002 && $] < 5.017006) };
12 12
 
13 13
 my $expected = "ok";
14 14
 my $received = GET_BODY_ASSERT "/TestPerl__hash_attack";

0 notes on commit 466c39f

Please sign in to comment.
Something went wrong with that request. Please try again.