mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibJS: Do not invoke Cell::vm in constructors before Cell is constructed
In a subclass of Cell, we cannot use Cell::vm() before the base Cell object itself is constructed. Use the Realm's VM instead. This was caught by UBSAN with vptr sanitation enabled.
This commit is contained in:
committed by
Andreas Kling
parent
3efe611dbf
commit
85e313077a
@@ -163,7 +163,7 @@ static double parse_date_string(String const& date_string)
|
||||
}
|
||||
|
||||
DateConstructor::DateConstructor(Realm& realm)
|
||||
: NativeFunction(vm().names.Date.as_string(), *realm.intrinsics().function_prototype())
|
||||
: NativeFunction(realm.vm().names.Date.as_string(), *realm.intrinsics().function_prototype())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user