This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Avoid function call overhead
[perl5.git] / regcomp.c
index 2a0350c..d3635cc 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -13491,7 +13491,7 @@ parseit:
         }
         else {
             /* Is a backslash; get the code point of the char after it */
-           if (UTF) {
+           if (UTF && ! UTF8_IS_INVARIANT(RExC_parse)) {
                value = utf8n_to_uvchr((U8*)RExC_parse,
                                   RExC_end - RExC_parse,
                                   &numlen, UTF8_ALLOW_DEFAULT);