[pcre-dev] [Bug 1798] New: Regression in value reported by …

Page principale
Supprimer ce message
Auteur: admin
Date:  
À: pcre-dev
Sujet: [pcre-dev] [Bug 1798] New: Regression in value reported by PCRE2_INFO_ALLOPTIONS wrt PCRE2_DUPNAMES
https://bugs.exim.org/show_bug.cgi?id=1798

            Bug ID: 1798
           Summary: Regression in value reported by PCRE2_INFO_ALLOPTIONS
                    wrt PCRE2_DUPNAMES
           Product: PCRE
           Version: 10.21 (PCRE2)
          Hardware: x86-64
                OS: Windows
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: ph10@???
          Reporter: lucas.trzesniewski@???
                CC: pcre-dev@???


Hello,

I spotted a regression between PCRE2 v10.20 and v10.21:
The value returned by pcre2_pattern_info for PCRE2_INFO_ALLOPTIONS doesn't
report the PCRE2_DUPNAMES flag anymore when the pattern contains (?J).

Here's some sample code to reproduce the issue:

    #include <stdio.h>


    #define PCRE2_CODE_UNIT_WIDTH 8
    #include <pcre2.h>


    int main(int argc, char **argv) {
        int errorcode;
        PCRE2_SIZE erroroffset;


        PCRE2_UCHAR versionString[64];
        if (pcre2_config(PCRE2_CONFIG_VERSION, &versionString) > 0)
            printf("PCRE2 version: %s\n", versionString);


        pcre2_code *re = pcre2_compile((PCRE2_SPTR)"(?J)(?<test>)(?<test>)",
PCRE2_ZERO_TERMINATED, 0, &errorcode, &erroroffset, 0);
        if (!re)
            return 1;


        uint32_t argOptions;
        if (!pcre2_pattern_info(re, PCRE2_INFO_ALLOPTIONS, &argOptions))
            printf("PCRE2_DUPNAMES: %s\n", argOptions & PCRE2_DUPNAMES ? "Yes"
: "No");


        pcre2_code_free(re);
        return 0;
    }


And here are the results for both versions:

    PCRE2 version: 10.20 2015-06-30
    PCRE2_DUPNAMES: Yes


    PCRE2 version: 10.21 2016-01-12
    PCRE2_DUPNAMES: No


I didn't check whether other flags are affected.

(Also, I'd like to take the opportunity to thank you for all your work on this
great library!)

Regards,
Lucas Trzesniewski

--
You are receiving this mail because:
You are on the CC list for the bug.