mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 13:27:35 +00:00
LibJS: Ensure RegExpStringIterator keeps the RegExp matcher object alive
Fixes a crash found with 'test-js -g' due to this object going out of scope.
This commit is contained in:
parent
1b8f73b6b3
commit
860417fb4f
2 changed files with 8 additions and 0 deletions
|
@ -24,4 +24,10 @@ RegExpStringIterator::RegExpStringIterator(Object& prototype, Object& regexp_obj
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RegExpStringIterator::visit_edges(Cell::Visitor& visitor)
|
||||||
|
{
|
||||||
|
Object::visit_edges(visitor);
|
||||||
|
visitor.visit(&m_regexp_object);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,8 @@ public:
|
||||||
void set_done() { m_done = true; }
|
void set_done() { m_done = true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
virtual void visit_edges(Cell::Visitor&) override;
|
||||||
|
|
||||||
Object& m_regexp_object;
|
Object& m_regexp_object;
|
||||||
String m_string;
|
String m_string;
|
||||||
bool m_global { false };
|
bool m_global { false };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue