This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use XDIGIT_VALUE().
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 14 Aug 2014 20:25:31 +0000 (16:25 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 15 Aug 2014 02:38:30 +0000 (22:38 -0400)
toke.c

diff --git a/toke.c b/toke.c
index 09bd8c0..374af95 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -10016,10 +10016,7 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp)
                     h++;
                     while (isXDIGIT(*h) || *h == '_') {
                         if (isXDIGIT(*h)) {
-                            const char* p = strchr(PL_hexdigit, *h);
-                            U8 b;
-                            assert(p);
-                            b = ((p - PL_hexdigit) & 0x0F);
+                            U8 b = XDIGIT_VALUE(*h);
                             total_bits += shift;
 #ifdef HEXFP_UV
                             hexfp_uv <<= shift;