From b1b0db946e9d1ec66660f70a4ec05e412bb331b6 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Mon, 17 May 2021 12:06:48 +0430 Subject: [PATCH] LibJS: Default-initialize the current_node pointer member in CallFrame Some parts of the code depend on this being nullptr without actually initializing it, leading to odd random crashes. e.g. `VM::call_internal`. --- Userland/Libraries/LibJS/Runtime/VM.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 78501e0b10..7cbac330fc 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -39,7 +39,7 @@ struct ScopeFrame { }; struct CallFrame { - const ASTNode* current_node; + const ASTNode* current_node { nullptr }; FlyString function_name; Value callee; Value this_value;