Skip to content

Fix macro for disabled match cache #13105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2025

Conversation

composerinteralia
Copy link
Contributor

The MEMOIZE_LOOKAROUND_MATCH_CACHE_POINT macro needs an argument otherwise we end up with:

../regexec.c:3955:2: error: called object type 'void' is not a function or function pointer
 3955 |         STACK_POS_END(stkp);
      |         ^~~~~~~~~~~~~~~~~~~
../regexec.c:1680:41: note: expanded from macro 'STACK_POS_END'
 1680 |     MEMOIZE_LOOKAROUND_MATCH_CACHE_POINT(k);\
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
../regexec.c:3969:7: error: called object type 'void' is not a function or function pointer
 3969 |       STACK_POP_TIL_POS_NOT;
      |       ^~~~~~~~~~~~~~~~~~~~~
../regexec.c:1616:41: note: expanded from macro 'STACK_POP_TIL_POS_NOT'
 1616 |     MEMOIZE_LOOKAROUND_MATCH_CACHE_POINT(stk);\
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

The macro definition with the match cache enabled already has the correct argument. This one is for when the match cache is disabled (I had disabled it while trying to learn more about how it works.)

The `MEMOIZE_LOOKAROUND_MATCH_CACHE_POINT` macro needs an argument
otherwise we end up with:

```
../regexec.c:3955:2: error: called object type 'void' is not a function or function pointer
 3955 |         STACK_POS_END(stkp);
      |         ^~~~~~~~~~~~~~~~~~~
../regexec.c:1680:41: note: expanded from macro 'STACK_POS_END'
 1680 |     MEMOIZE_LOOKAROUND_MATCH_CACHE_POINT(k);\
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
../regexec.c:3969:7: error: called object type 'void' is not a function or function pointer
 3969 |       STACK_POP_TIL_POS_NOT;
      |       ^~~~~~~~~~~~~~~~~~~~~
../regexec.c:1616:41: note: expanded from macro 'STACK_POP_TIL_POS_NOT'
 1616 |     MEMOIZE_LOOKAROUND_MATCH_CACHE_POINT(stk);\
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
```

The macro definition with the match cache enabled already has the
correct argument. This one is for when the match cache is disabled (I
had disabled it while trying to learn more about how it works.)
@nobu nobu merged commit 29b26fd into ruby:master Apr 13, 2025
77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants