From 1fe6a422f13200fe885ab9ccdc1626f18e6c12b9 Mon Sep 17 00:00:00 2001 From: davidot Date: Mon, 11 Oct 2021 20:30:31 +0200 Subject: [PATCH] LibJS: Fix null deref in ObjectProperty::dump() --- Userland/Libraries/LibJS/AST.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 060623995b..5339e5e2d3 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -2272,8 +2272,15 @@ void VariableDeclarator::dump(int indent) const void ObjectProperty::dump(int indent) const { ASTNode::dump(indent); - m_key->dump(indent + 1); - m_value->dump(indent + 1); + + if (m_property_type == Type::Spread) { + print_indent(indent + 1); + outln("...Spreading"); + m_key->dump(indent + 1); + } else { + m_key->dump(indent + 1); + m_value->dump(indent + 1); + } } void ObjectExpression::dump(int indent) const