зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1369994 - Ensure template objects for typed arrays are initialized properly before exposing them to GC. r=sfink
This commit is contained in:
Родитель
8a5ba394b7
Коммит
549947fd25
|
@ -578,11 +578,6 @@ class TypedArrayObjectTemplate : public TypedArrayObject
|
||||||
RootedObject tmp(cx, NewBuiltinClassInstance(cx, clasp, allocKind, newKind));
|
RootedObject tmp(cx, NewBuiltinClassInstance(cx, clasp, allocKind, newKind));
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
if (script && !ObjectGroup::setAllocationSiteObjectGroup(cx, script, pc, tmp,
|
|
||||||
newKind == SingletonObject))
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
TypedArrayObject* tarray = &tmp->as<TypedArrayObject>();
|
TypedArrayObject* tarray = &tmp->as<TypedArrayObject>();
|
||||||
initTypedArraySlots(cx, tarray, len);
|
initTypedArraySlots(cx, tarray, len);
|
||||||
|
@ -592,6 +587,12 @@ class TypedArrayObjectTemplate : public TypedArrayObject
|
||||||
// nullptr and avoid allocating memory that will never be used.
|
// nullptr and avoid allocating memory that will never be used.
|
||||||
tarray->initPrivate(nullptr);
|
tarray->initPrivate(nullptr);
|
||||||
|
|
||||||
|
if (script && !ObjectGroup::setAllocationSiteObjectGroup(cx, script, pc, tmp,
|
||||||
|
newKind == SingletonObject))
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
return tarray;
|
return tarray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче