mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1211100 - Add Vector::infallibleEmplaceBack and use it in JSScript::initScriptCounts() r=nbp
This commit is contained in:
parent
20f13d194b
commit
07915f2ecf
@ -1334,7 +1334,7 @@ JSScript::initScriptCounts(JSContext* cx)
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < jumpTargets.length(); i++)
|
||||
MOZ_ALWAYS_TRUE(base.emplaceBack(pcToOffset(jumpTargets[i])));
|
||||
base.infallibleEmplaceBack(pcToOffset(jumpTargets[i]));
|
||||
|
||||
// Create compartment's scriptCountsMap if necessary.
|
||||
ScriptCountsMap* map = compartment()->scriptCountsMap;
|
||||
|
@ -603,6 +603,12 @@ public:
|
||||
{
|
||||
internalAppend(aBegin, aLength);
|
||||
}
|
||||
template<typename... Args>
|
||||
void infallibleEmplaceBack(Args&&... aArgs)
|
||||
{
|
||||
infallibleGrowByUninitialized(1);
|
||||
new (&back()) T(Forward<Args>(aArgs)...);
|
||||
}
|
||||
|
||||
void popBack();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user