зеркало из https://github.com/mozilla/gecko-dev.git
Bug 614928 PropertyTree::insertChild returns without unlocking cx->runtime when hash->add fails. r=jorendorff.
This commit is contained in:
Родитель
5932b8f038
Коммит
5d7d187db2
|
@ -140,7 +140,7 @@ KidsChunk::destroy(JSContext *cx, KidsChunk *chunk)
|
|||
|
||||
/*
|
||||
* NB: Called with cx->runtime->gcLock held, always.
|
||||
* On failure, return null after unlocking the GC and reporting out of memory.
|
||||
* On failure, return false after unlocking the GC and reporting out of memory.
|
||||
*/
|
||||
bool
|
||||
PropertyTree::insertChild(JSContext *cx, Shape *parent, Shape *child)
|
||||
|
@ -219,8 +219,11 @@ PropertyTree::insertChild(JSContext *cx, Shape *parent, Shape *child)
|
|||
KidsHash *hash = kidp->toHash();
|
||||
KidsHash::AddPtr addPtr = hash->lookupForAdd(child);
|
||||
if (!addPtr) {
|
||||
if (!hash->add(addPtr, child))
|
||||
if (!hash->add(addPtr, child)) {
|
||||
JS_UNLOCK_GC(cx->runtime);
|
||||
JS_ReportOutOfMemory(cx);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// FIXME ignore duplicate child case here, going thread-local soon!
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче