mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
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
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
Add a link
Reference in a new issue