Skip to content

JIT/non-JIT match difference with anchored regexes using (*SKIP) #326

@addisoncrump

Description

@addisoncrump

Discovered by #322.

The pattern A(*SKIP)A| (number of As on either side may be replaced by any non-zero amount of literals) inconsistently matches itself (and I think any string) in combination with the anchored flag being set:

sh-5.2$ xxd skip_crash 
00000000: 0000 0000 0000 0080 4128 2a53 4b49 5029  ........A(*SKIP)
00000010: 417c                                     A|
sh-5.2$ ./pcre2_fuzzer skip_crash 
Encountered failure while performing match errorcode comparison; context:
Pattern/sample string (hex encoded): 41282a534b495029417c
Compile options 80100000 never_backslash_c,anchored
Match options 00002000
Non-JIT'd operation emitted an error: no match (-1)
JIT'd operation did not emit an error.
1 matches discovered by JIT'd regex:
Match 0 (hex encoded): 

I suspect that in this case, the JIT code emitted for SKIP does not consider anchoring, but I haven't investigated further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions