From 30f288e5d792d18771ba4b34e20b295483120d35 Mon Sep 17 00:00:00 2001 From: VegOwOtenks Date: Thu, 13 Jun 2024 16:55:57 +0200 Subject: [PATCH] Fixed uninitialised memory lucky bug --- src/regex/match.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;