This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
revert the Perl_croak_nocontext() change to PERL_HASH()
authorYves Orton <demerphq@gmail.com>
Fri, 2 Jun 2017 02:17:51 +0000 (04:17 +0200)
committerYves Orton <demerphq@gmail.com>
Fri, 2 Jun 2017 03:14:14 +0000 (05:14 +0200)
it only appeared to work, but actually was not being invoked in my testing.

Once it was tested properly it became clear that Perl_croak_nocontext()
is not always available where things are calling PERL_HASH(). Need to investigate
further how to make this work.

hv_func.h

index 8230fb4..4be4214 100644 (file)
--- a/hv_func.h
+++ b/hv_func.h
@@ -96,9 +96,7 @@
 #define _PERL_HASH_WITH_STATE(state,str,len)                                            \
     (LIKELY(len <= SBOX32_MAX_LEN)                                                      \
         ? sbox32_hash_with_state((state + __PERL_HASH_STATE_BYTES),(U8*)(str),(len))    \
-        : UNLIKELY(len > (STRLEN) I32_MAX)                                              \
-          ? Perl_croak_nocontext("Sorry, hash keys must be smaller than 2**31 bytes")   \
-          : __PERL_HASH_WITH_STATE((state),(str),(len)))
+        : __PERL_HASH_WITH_STATE((state),(str),(len)))
 
 #endif