Bug 993965 - Fix busted OOM handling in some places where OOM is not practically possible, for the benefit of fuzzers. r=h4writer.

This commit is contained in:
Jason Orendorff 2014-05-22 08:18:00 -05:00
parent 2518035cb2
commit 5a1a3e1847

View File

@ -949,8 +949,11 @@ js::StartOffThreadCompression(ExclusiveContext *cx, SourceCompressionTask *task)
AutoLockWorkerThreadState lock;
if (!WorkerThreadState().compressionWorklist().append(task))
if (!WorkerThreadState().compressionWorklist().append(task)) {
if (JSContext *maybecx = cx->maybeJSContext())
js_ReportOutOfMemory(maybecx);
return false;
}
WorkerThreadState().notifyOne(GlobalWorkerThreadState::PRODUCER);
return true;