Bug 660670: Report an error on OOM in Parser::analyzeFunction (r=jimb)

This commit is contained in:
Paul Biggar 2011-06-06 14:24:11 -07:00
parent 08fcb0b61d
commit 118bf3fdae

View File

@ -2193,8 +2193,10 @@ bool
Parser::markFunArgs(JSFunctionBox *funbox)
{
JSFunctionBoxQueue queue;
if (!queue.init(functionCount))
if (!queue.init(functionCount)) {
js_ReportOutOfMemory(context);
return false;
}
FindFunArgs(funbox, -1, &queue);
while ((funbox = queue.pull()) != NULL) {