[perl.git] branch blead updated. v5.29.0-20-gabb9aadc72

2018-06-29 Thread Karl Williamson
In perl.git, the branch blead has been updated



- Log -
commit abb9aadc729e283764df9f7ac23799e957287bc7
Author: Jim Cromie 
Date:   Fri Jun 29 20:26:21 2018 -0600

fix stren in PERL_MEM_LOG builds

---

Summary of changes:
 util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util.c b/util.c
index 53fa197b60..9d3f5ba0f1 100644
--- a/util.c
+++ b/util.c
@@ -4761,7 +4761,7 @@ S_mem_log_common(enum mem_log_type mlt, const UV n,
 * timeval. */
{
STRLEN len;
-const char* endptr = pmlenv + stren(pmlenv);
+const char* endptr = pmlenv + strlen(pmlenv);
int fd;
 UV uv;
 if (grok_atoUV(pmlenv, , ) /* Ignore endptr. */

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.29.0-19-g4c821bdad5

2018-06-29 Thread Karl Williamson
In perl.git, the branch blead has been updated



- Log -
commit 4c821bdad549847bbb50929bc86cc3baa3676829
Author: Karl Williamson 
Date:   Fri Jun 29 08:29:24 2018 -0600

perldeprecation: Clean up text about grapheme delims

This changes the text to make more sense in light of the fact that the
the deprecation has changed to illegality.

---

Summary of changes:
 pod/perldeprecation.pod | 34 +++---
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/pod/perldeprecation.pod b/pod/perldeprecation.pod
index 5b4f406894..a41f2c6a35 100644
--- a/pod/perldeprecation.pod
+++ b/pod/perldeprecation.pod
@@ -230,25 +230,21 @@ A grapheme is what appears to a native-speaker of a 
language to be a
 character.  In Unicode (and hence Perl) a grapheme may actually be
 several adjacent characters that together form a complete grapheme.  For
 example, there can be a base character, like "R" and an accent, like a
-circumflex "^", that appear when displayed to be a single character with
-the circumflex hovering over the "R".  Perl currently allows things like
-that circumflex to be delimiters of strings, patterns, I.  When
-displayed, the circumflex would look like it belongs to the character
-just to the left of it.  In order to move the language to be able to
-accept graphemes as delimiters, we have to deprecate the use of
-delimiters which aren't graphemes by themselves.  Also, a delimiter must
-already be assigned (or known to be never going to be assigned) to try
-to future-proof code, for otherwise code that works today would fail to
-compile if the currently unassigned delimiter ends up being something
-that isn't a stand-alone grapheme.  Because Unicode is never going to
-assign
-L, nor
-L, those can be delimiters, and
-their use won't raise this warning.
-
-As of Perl 5.30, delimiters which are unassigned code points, or which
-are non-standalone graphemes are fatal.
+circumflex "^", that appear to be a single character when displayed,
+with the circumflex hovering over the "R".
+
+As of Perl 5.30, use of delimiters which are non-standalone graphemes is
+fatal, in order to move the language to be able to accept
+multi-character graphemes as delimiters.
+
+Also, as of Perl 5.30, delimiters which which are unassigned code points
+but that may someday become assigned are prohibited.  Otherwise, code
+that works today would fail to compile if the currently unassigned
+delimiter ends up being something that isn't a stand-alone grapheme.
+Because Unicode is never going to assign L, nor L, those can be delimiters.
 
 =head3 In XS code, use of various macros dealing with UTF-8.
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.29.0-18-g6ee81574cd

2018-06-29 Thread Dave Mitchell
In perl.git, the branch blead has been updated



- Log -
commit 6ee81574cd3682da001e8c3e7a931f034c4c31b9
Merge: 957a9e817d adebb90ded
Author: David Mitchell 
Date:   Fri Jun 29 14:38:10 2018 +0100

[MERGE] fixups to Perl_my_setenv()

commit adebb90ded7502ff44bd789b300b1193c89c047c
Author: David Mitchell 
Date:   Fri Jun 29 14:30:17 2018 +0100

Perl_my_setenv(): re-indent cpp directive lines

The indentation was all over the place.  Whitespace-only changes apart
from fixing code comments at end of '#endif' lines.

commit de5576aa52889a6b4c37e8137a9ebfe0abe75619
Author: David Mitchell 
Date:   Fri Jun 29 14:12:18 2018 +0100

Perl_my_setenv: move code comment

This comment about VMS seems to have drifted over time away from the
ifdef it refs to

commit 34716e2a6ee2af96078d62b065b7785c001194be
Author: David Mitchell 
Date:   Fri Jun 29 13:37:03 2018 +0100

Perl_my_setenv(); handle integer wrap

RT #133204

Wean this function off int/I32 and onto UV/Size_t.
Also, replace all malloc-ish calls with a wrapper that does
overflow checks,

In particular, it was doing (nlen + vlen + 2) which could wrap when
the combined length of the environment variable name and value
exceeded around 0x7fff.

The wrapper check function is probably overkill, but belt and braces...

NB this function has several variant parts, #ifdef'ed by platform
type; I have blindly changed the parts that aren't compiled under linux.

---

Summary of changes:
 util.c | 154 -
 1 file changed, 104 insertions(+), 50 deletions(-)

diff --git a/util.c b/util.c
index 7282dd9cfe..53fa197b60 100644
--- a/util.c
+++ b/util.c
@@ -2060,149 +2060,203 @@ Perl_new_warnings_bitfield(pTHX_ STRLEN *buffer, 
const char *const bits,
Copy(val, s+(nlen+1), vlen, char); \
*(s+(nlen+1+vlen)) = '\0'
 
+
+
 #ifdef USE_ENVIRON_ARRAY
-   /* VMS' my_setenv() is in vms.c */
-#if !defined(WIN32) && !defined(NETWARE)
+/* NB: VMS' my_setenv() is in vms.c */
+
+/* small wrapper for use by Perl_my_setenv that mallocs, or reallocs if
+ * 'current' is non-null, with up to three sizes that are added together.
+ * It handles integer overflow.
+ */
+static char *
+S_env_alloc(void *current, Size_t l1, Size_t l2, Size_t l3, Size_t size)
+{
+void *p;
+Size_t sl, l = l1 + l2;
+
+if (l < l2)
+goto panic;
+l += l3;
+if (l < l3)
+goto panic;
+sl = l * size;
+if (sl < l)
+goto panic;
+
+p = current
+? safesysrealloc(current, sl)
+: safesysmalloc(sl);
+if (p)
+return (char*)p;
+
+  panic:
+croak_memory_wrap();
+}
+
+
+#  if !defined(WIN32) && !defined(NETWARE)
+
 void
 Perl_my_setenv(pTHX_ const char *nam, const char *val)
 {
   dVAR;
-#ifdef __amigaos4__
+#ifdef __amigaos4__
   amigaos4_obtain_environ(__FUNCTION__);
-#endif
-#ifdef USE_ITHREADS
+#endif
+
+#ifdef USE_ITHREADS
   /* only parent thread can modify process environment */
   if (PL_curinterp == aTHX)
-#endif
+#endif
   {
-#ifndef PERL_USE_SAFE_PUTENV
+
+#ifndef PERL_USE_SAFE_PUTENV
 if (!PL_use_safe_putenv) {
 /* most putenv()s leak, so we manipulate environ directly */
-I32 i;
-const I32 len = strlen(nam);
-int nlen, vlen;
+UV i;
+Size_t vlen, nlen = strlen(nam);
 
 /* where does it go? */
 for (i = 0; environ[i]; i++) {
-if (strnEQ(environ[i],nam,len) && environ[i][len] == '=')
+if (strnEQ(environ[i], nam, nlen) && environ[i][nlen] == '=')
 break;
 }
 
 if (environ == PL_origenviron) {   /* need we copy environment? */
-I32 j;
-I32 max;
+UV j, max;
 char **tmpenv;
 
 max = i;
 while (environ[max])
 max++;
-tmpenv = (char**)safesysmalloc((max+2) * sizeof(char*));
+
+/* XXX shouldn't that be max+1 rather than max+2 ??? - DAPM */
+tmpenv = (char**)S_env_alloc(NULL, max, 2, 0, sizeof(char*));
+
 for (j=0; j