diff --git a/src/regex/match.c b/src/regex/match.c index f6c3913..ffa3e62 100644 --- a/src/regex/match.c +++ b/src/regex/match.c @@ -336,7 +336,9 @@ static int _RegexMatcher_Create(RegexMatcher* matcher, Regex* regex, StringView return stack_code; } - RegexMatchThread* root_thread = _RegexMatchThreadGroup_NewThread(&matcher->top_group); + RegexMatchThread* root_thread = _RegexMatchThreadGroup_NewThread( + &matcher->top_group + ); if (root_thread == NULL) { RegexMatchThreadGroup_Destroy2(&matcher->top_group); DynamicArray_Destroy(&matcher->visitor_stack); @@ -347,6 +349,7 @@ static int _RegexMatcher_Create(RegexMatcher* matcher, Regex* regex, StringView DynamicArray_Destroy(&matcher->visitor_stack); return ENOMEM; } + root_thread->number = 0; matcher->depth = 1;