This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_sv_vcatpvfn_flags: add comment about wrap
authorDavid Mitchell <davem@iabyn.com>
Thu, 1 Jun 2017 10:27:20 +0000 (11:27 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 7 Jun 2017 08:11:08 +0000 (09:11 +0100)
sv.c

diff --git a/sv.c b/sv.c
index 685aa9b..cb90a07 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -13016,6 +13016,9 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
 
             {
                 STRLEN pr = has_precis ? precis : 6; /* known default */
+                /* this probably can't wrap, since precis is limited
+                 * to 1/4 address space size, but better safe than sorry
+                 */
                 if (float_need >= ((STRLEN)~0) - pr)
                     croak_memory_wrap();
                 float_need += pr;