diff --git a/js/src/frontend/ParserAtom.cpp b/js/src/frontend/ParserAtom.cpp index 5c15d245393f..acc3a51b47aa 100644 --- a/js/src/frontend/ParserAtom.cpp +++ b/js/src/frontend/ParserAtom.cpp @@ -282,6 +282,9 @@ JSAtom* ParserAtomEntry::instantiate(JSContext* cx, return nullptr; } auto index = atomCache.atoms.length(); + + // This cannot be infallibleAppend because there are toJSAtom consumers that + // doesn't reserve CompilationAtomCache.atoms beforehand if (!atomCache.atoms.append(atom)) { js::ReportOutOfMemory(cx); return nullptr;