mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +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
Notes:
sideshowbarker
2024-07-18 08:55:09 +09:00
Author: https://github.com/trflynn89
Commit: 860417fb4f
Pull-request: https://github.com/SerenityOS/serenity/pull/8810
Reviewed-by: https://github.com/linusg
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