Selaa lähdekoodia

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`.
Ali Mohammad Pur 4 vuotta sitten
vanhempi
commit
b1b0db946e
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      Userland/Libraries/LibJS/Runtime/VM.h

+ 1 - 1
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;