LibJS: Call the correct base class in LexicalEnvironment::visit_edges()

We were calling directly up to Cell, skipping over ScopeObject.
This made us not mark the scope chain parent for lexical environments,
sometimes causing them to get GC'd and use-after-free'd.

Found by Fuzzilli.

Fixes #5140.
This commit is contained in:
Andreas Kling 2021-01-28 10:13:47 +01:00
parent 7ec8f83a7f
commit 803a20fa86
Notes: sideshowbarker 2024-07-18 22:47:45 +09:00

View file

@ -63,7 +63,7 @@ LexicalEnvironment::~LexicalEnvironment()
void LexicalEnvironment::visit_edges(Visitor& visitor)
{
Cell::visit_edges(visitor);
Base::visit_edges(visitor);
visitor.visit(m_this_value);
visitor.visit(m_home_object);
visitor.visit(m_new_target);