mirror of
https://github.com/oven-sh/bun
synced 2026-02-27 20:17:23 +01:00
fix: use WriteBarrierEarlyInit for WriteBarriers initialized before finishCreation
NodeVMModule::m_moduleWrapper and NodeVMSyntheticModule::m_syntheticEvaluationSteps were using the regular WriteBarrier constructor (vm, this, value) in their member initializer lists, which calls vm.writeBarrier(this, ...) before the cell is markable (finishCreation has not been called yet). Use WriteBarrierEarlyInit instead, consistent with the adjacent m_context field and other similar patterns in the codebase.
This commit is contained in:
@@ -154,7 +154,7 @@ NodeVMModule::NodeVMModule(JSC::VM& vm, JSC::Structure* structure, WTF::String i
|
||||
: Base(vm, structure)
|
||||
, m_identifier(WTF::move(identifier))
|
||||
, m_context(context && context.isObject() ? asObject(context) : nullptr, JSC::WriteBarrierEarlyInit)
|
||||
, m_moduleWrapper(vm, this, moduleWrapper)
|
||||
, m_moduleWrapper(moduleWrapper, JSC::WriteBarrierEarlyInit)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ private:
|
||||
NodeVMSyntheticModule(JSC::VM& vm, JSC::Structure* structure, WTF::String identifier, JSValue context, JSValue moduleWrapper, WTF::HashSet<String> exportNames, JSValue syntheticEvaluationSteps)
|
||||
: Base(vm, structure, WTF::move(identifier), context, moduleWrapper)
|
||||
, m_exportNames(WTF::move(exportNames))
|
||||
, m_syntheticEvaluationSteps(vm, this, syntheticEvaluationSteps)
|
||||
, m_syntheticEvaluationSteps(syntheticEvaluationSteps, JSC::WriteBarrierEarlyInit)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user