summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-19 11:02:20 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-19 11:02:20 +0100
commitf0b49ae04b663c7ae54ca1f3c990ab81c3bded80 (patch)
treee07e4bcbd8b725ca2c59ae119bf17c3dba8e06be /Libraries
parentd013753f8339dc2ea957e1d0152ee017dc0393fb (diff)
downloadserenity-f0b49ae04b663c7ae54ca1f3c990ab81c3bded80.zip
LibJS: Fix reference leak in ASTNode::append()
Using make<T> like this would create an unadopted object whose refcount would never reach zero.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibJS/AST.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibJS/AST.h b/Libraries/LibJS/AST.h
index 404e376d30..7915fe7baa 100644
--- a/Libraries/LibJS/AST.h
+++ b/Libraries/LibJS/AST.h
@@ -87,7 +87,7 @@ public:
template<typename T, typename... Args>
T& append(Args&&... args)
{
- auto child = make<T>(forward<Args>(args)...);
+ auto child = create_ast_node<T>(forward<Args>(args)...);
m_children.append(move(child));
return static_cast<T&>(m_children.last());
}