Fixed uninitialised memory lucky bug

This commit is contained in:
VegOwOtenks 2024-06-13 16:55:57 +02:00
parent 0b651b819a
commit 30f288e5d7

View file

@ -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;