Index: src/ast/ast.h |
diff --git a/src/ast/ast.h b/src/ast/ast.h |
index 3dc09b1ae3cfcc5346214bf8b496e73fbbc431af..35bfbcbfd73919bac0f5ed246062aa08d90bc55e 100644 |
--- a/src/ast/ast.h |
+++ b/src/ast/ast.h |
@@ -3069,11 +3069,21 @@ class AstTraversalVisitor : public AstVisitor<AstTraversalVisitor> { |
class AstNodeFactory final BASE_EMBEDDED { |
public: |
explicit AstNodeFactory(AstValueFactory* ast_value_factory) |
- : local_zone_(ast_value_factory->zone()), |
- parser_zone_(ast_value_factory->zone()), |
- ast_value_factory_(ast_value_factory) {} |
+ : local_zone_(nullptr), |
+ parser_zone_(nullptr), |
+ ast_value_factory_(ast_value_factory) { |
+ if (ast_value_factory != nullptr) { |
+ local_zone_ = ast_value_factory->zone(); |
+ parser_zone_ = ast_value_factory->zone(); |
+ } |
+ } |
AstValueFactory* ast_value_factory() const { return ast_value_factory_; } |
+ void set_ast_value_factory(AstValueFactory* ast_value_factory) { |
+ ast_value_factory_ = ast_value_factory; |
+ local_zone_ = ast_value_factory->zone(); |
+ parser_zone_ = ast_value_factory->zone(); |
+ } |
VariableDeclaration* NewVariableDeclaration(VariableProxy* proxy, |
VariableMode mode, Scope* scope, |