diff options
author | Ma Lin <animalize@users.noreply.github.com> | 2022-04-19 14:49:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-19 14:49:36 (GMT) |
commit | e4e8895ae36b44994e3f7b018345ba203ce6b55c (patch) | |
tree | 75dfc4577b68bc470c900256e157c189a2585464 /Modules | |
parent | 061a8bf77c80036bed3ef4973fe0c99705c83fc6 (diff) | |
download | cpython-e4e8895ae36b44994e3f7b018345ba203ce6b55c.zip cpython-e4e8895ae36b44994e3f7b018345ba203ce6b55c.tar.gz cpython-e4e8895ae36b44994e3f7b018345ba203ce6b55c.tar.bz2 |
gh-91616: re module, fix .fullmatch() mismatch when using Atomic Grouping or Possessive Quantifiers (GH-91681)
These jumps should use DO_JUMP0() instead of DO_JUMP():
- JUMP_POSS_REPEAT_1
- JUMP_POSS_REPEAT_2
- JUMP_ATOMIC_GROUP
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_sre/sre_lib.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_sre/sre_lib.h b/Modules/_sre/sre_lib.h index db624aa..efd6fde 100644 --- a/Modules/_sre/sre_lib.h +++ b/Modules/_sre/sre_lib.h @@ -1259,8 +1259,8 @@ dispatch: /* Check for minimum required matches. */ while (ctx->count < (Py_ssize_t)pattern[1]) { /* not enough matches */ - DO_JUMP(JUMP_POSS_REPEAT_1, jump_poss_repeat_1, - &pattern[3]); + DO_JUMP0(JUMP_POSS_REPEAT_1, jump_poss_repeat_1, + &pattern[3]); if (ret) { RETURN_ON_ERROR(ret); ctx->count++; @@ -1306,8 +1306,8 @@ dispatch: /* We have not reached the maximin matches, so try to match once more. */ - DO_JUMP(JUMP_POSS_REPEAT_2, jump_poss_repeat_2, - &pattern[3]); + DO_JUMP0(JUMP_POSS_REPEAT_2, jump_poss_repeat_2, + &pattern[3]); /* Check to see if the last attempted match succeeded. */ @@ -1348,15 +1348,15 @@ dispatch: TRACE(("|%p|%p|ATOMIC_GROUP\n", pattern, ptr)); /* Set the global Input pointer to this context's Input - pointer */ + pointer */ state->ptr = ptr; /* Evaluate the Atomic Group in a new context, terminating when the end of the group, represented by a SUCCESS op code, is reached. */ /* Group Pattern begins at an offset of 1 code. */ - DO_JUMP(JUMP_ATOMIC_GROUP, jump_atomic_group, - &pattern[1]); + DO_JUMP0(JUMP_ATOMIC_GROUP, jump_atomic_group, + &pattern[1]); /* Test Exit Condition */ RETURN_ON_ERROR(ret); |