LibJS: Deal with a FIXME in Shape::ensure_property_table()
Prevent GC while messing with the shape transition chain.
This commit is contained in:
parent
606f83436d
commit
d830c107ce
Notes:
sideshowbarker
2024-07-19 02:48:08 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d830c107cef
1 changed files with 2 additions and 2 deletions
|
@ -24,6 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <LibJS/Heap/DeferGC.h>
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/Shape.h>
|
||||
|
@ -145,8 +146,7 @@ void Shape::ensure_property_table() const
|
|||
return;
|
||||
m_property_table = make<HashMap<StringOrSymbol, PropertyMetadata>>();
|
||||
|
||||
// FIXME: We need to make sure the GC doesn't collect the transition chain as we're building it.
|
||||
// Maybe some kind of RAII "prevent GC for a moment" helper thingy?
|
||||
DeferGC defer(heap());
|
||||
|
||||
Vector<const Shape*> transition_chain;
|
||||
for (auto* shape = this; shape->m_previous; shape = shape->m_previous) {
|
||||
|
|
Loading…
Add table
Reference in a new issue