Bug 1285237 - Consider ParseNodeAllocator::allocNode as fallible. r=jorendorff, a=ritu
--- a/js/src/frontend/ParseNode.cpp
+++ b/js/src/frontend/ParseNode.cpp
@@ -554,16 +554,17 @@ ParseNodeAllocator::freeTree(ParseNode*
void*
ParseNodeAllocator::allocNode()
{
if (ParseNode* pn = freelist) {
freelist = pn->pn_next;
return pn;
}
+ LifoAlloc::AutoFallibleScope fallibleAllocator(&alloc);
void* p = alloc.alloc(sizeof (ParseNode));
if (!p)
ReportOutOfMemory(cx);
return p;
}
ParseNode*
ParseNode::appendOrCreateList(ParseNodeKind kind, JSOp op, ParseNode* left, ParseNode* right,