Skip to content

Conversation

@romange
Copy link
Collaborator

@romange romange commented Jun 18, 2025

Also add more edge-case tests taken from Valkey.

Also add more edge-case tests taken from Valkey.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Copy link
Contributor

@kostasrim kostasrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm -- let's see if everything passes


// TODO: to fix this: TEST_STRINGMATCH("[\\a]", "A", 0, 1);
TEST_STRINGMATCH("[\\A]", "A", 1, 1);
// TODO: to fix this: TEST_STRINGMATCH("[\\A]", "a", 0, 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is broken for us and valkey ?

while (stringLen) {
if (stringmatchlen_impl(pattern + 1, patternLen - 1, string, stringLen, nocase,
skipLongerMatches))
skipLongerMatches, nesting + 1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see the algorithm is recursive and it can blow out the stack (especially for us because fiber stack is small). +1 on this

I wonder if recursion was a problem for Valkey why didn't they rewrite the algorithm to use iterations instead of recursions 🤷

@romange romange merged commit 39f2cec into main Jun 18, 2025
10 checks passed
@romange romange deleted the Pr4 branch June 18, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants