Work around for [perl $133136]
authorKarl Williamson <khw@cpan.org>
Tue, 1 May 2018 17:51:19 +0000 (11:51 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 16 May 2018 21:33:59 +0000 (15:33 -0600)
This commit is a blatant kludge to work around a failing test in
Lexical::SealRequireHints.  The test is wrong, checking for an internal
detail that has changed.

This commit adds a conditional for the exact input that's failing, and
if found, uses the old method, so the test passes.

The failing input is the regex pattern

    foo\p{Alnum}

'foo' is unlikely to be found in practice outside of .t files, and
this particular pattern rarely even in those.  So this should not slow
down real production code.

regcomp.c

index 800ab2d..585b84d 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -16775,7 +16775,18 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
                     const char * const colon_colon = "::";
                     bool invert;
 
-                    SV* invlist = parse_uniprop_string(name, n, FOLD, &invert);
+                    SV* invlist;
+
+                    /* Temporary workaround for [perl #133136].  For this
+                     * precise input that is in the .t that is failing, use the
+                     * old method so that that .t passes */
+                    if (memEQs(RExC_start, e + 1 - RExC_start, "foo\\p{Alnum}"))
+                    {
+                        invlist = NULL;
+                    }
+                    else {
+                        invlist = parse_uniprop_string(name, n, FOLD, &invert);
+                    }
                     if (invlist) {
                         if (invert) {
                             value ^= 'P' ^ 'p';