Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
pass test_re.py
  • Loading branch information
wjssz committed Feb 19, 2019
commit 740f53c66d854803a0c6f274ded4556d5db0f09c
8 changes: 6 additions & 2 deletions Modules/sre_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,10 @@ do { \
if (sizeof(type) > state->data_stack_size - alloc_pos) { \
int j = data_stack_grow(state, sizeof(type)); \
if (j < 0) return j; \
if (ctx_pos != -1) \
if (ctx_pos >= 0) \
DATA_STACK_LOOKUP_AT(state, SRE(match_context), ctx, ctx_pos); \
if (ctx->u.rep >= 0) \
DATA_STACK_LOOKUP_AT(state, SRE_REPEAT, temp_repeat, ctx->u.rep); \
} \
ptr = (type*)(state->data_stack+alloc_pos); \
state->data_stack_base += sizeof(type); \
Expand All @@ -441,8 +443,10 @@ do { \
if (size > state->data_stack_size - state->data_stack_base) { \
int j = data_stack_grow(state, size); \
if (j < 0) return j; \
if (ctx_pos != -1) \
if (ctx_pos >= 0) \
DATA_STACK_LOOKUP_AT(state, SRE(match_context), ctx, ctx_pos); \
if (ctx->u.rep >= 0) \
DATA_STACK_LOOKUP_AT(state, SRE_REPEAT, temp_repeat, ctx->u.rep); \
} \
memcpy(state->data_stack+state->data_stack_base, data, size); \
state->data_stack_base += size; \
Expand Down