Re: [ID 20010528.007] "\x{" causes panic:constant overflowed allocated space
Hugo van der Sanden [Tue, 29 May 2001 00:23:23 +0000 (01:23 +0100)]
Message-Id: <200105282323.AAA07930@crypt.compulink.co.uk>

p4raw-id: //depot/perl@10272

toke.c

diff --git a/toke.c b/toke.c
index febb820..b052e9a 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1439,14 +1439,14 @@ S_scan_const(pTHX_ char *start)
                ++s;
                if (*s == '{') {
                    char* e = strchr(s, '}');
+                   STRLEN len = 1;             /* allow underscores */
+
                    if (!e) {
                        yyerror("Missing right brace on \\x{}");
-                       e = s;
-                   }
-                   else {
-                       STRLEN len = 1;         /* allow underscores */
-                       uv = (UV)scan_hex(s + 1, e - s - 1, &len);
+                       ++s;
+                       continue;
                    }
+                   uv = (UV)scan_hex(s + 1, e - s - 1, &len);
                    s = e + 1;
                }
                else {