mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Bug 614928 PropertyTree::insertChild returns without unlocking cx->runtime when hash->add fails. r=jorendorff.
This commit is contained in:
parent
5932b8f038
commit
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!
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user