This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Add explanatory comment
authorKarl Williamson <public@khwilliamson.com>
Sun, 14 Nov 2010 05:39:23 +0000 (22:39 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 22 Nov 2010 21:32:53 +0000 (13:32 -0800)
regcomp.c

index acc58f1..7f0e582 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -851,11 +851,15 @@ S_cl_or(const RExC_state_t *pRExC_state, struct regnode_charclass_class *cl, con
     if (or_with->flags & ANYOF_FOLD)
        cl->flags |= ANYOF_FOLD;
 
+    /* If both nodes match something outside the bitmap, but what they match
+     * outside is not the same pointer, and hence not easily compared, give up
+     * and allow the start class to match everything outside the bitmap */
     if (cl->flags & ANYOF_NONBITMAP && or_with->flags & ANYOF_NONBITMAP &&
        ARG(cl) != ARG(or_with)) {
        cl->flags |= ANYOF_UNICODE_ALL;
        cl->flags &= ~ANYOF_NONBITMAP;
     }
+
     if (or_with->flags & ANYOF_UNICODE_ALL) {
        cl->flags |= ANYOF_UNICODE_ALL;
        cl->flags &= ~ANYOF_NONBITMAP;