From 9d15dfd22d0d57eba1994db2e13b4a215780f877 Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Tue, 24 Apr 2012 20:03:48 +0200 Subject: [PATCH] Bug 735036 - Check for OOM in debug only method. r=luke --- js/public/HashTable.h | 2 +- js/src/jsgc.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/js/public/HashTable.h b/js/public/HashTable.h index 259725f3a86..b801e91262f 100644 --- a/js/public/HashTable.h +++ b/js/public/HashTable.h @@ -384,7 +384,7 @@ class HashTable : private AllocPolicy mutationCount(0) {} - bool init(uint32_t length) + MOZ_WARN_UNUSED_RESULT bool init(uint32_t length) { /* Make sure that init isn't called twice. */ JS_ASSERT(table == NULL); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index cf248d826d8..4d955c02e51 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -4193,7 +4193,8 @@ StartVerifyBarriers(JSRuntime *rt) trc->edgeptr = (char *)trc->root; trc->term = trc->edgeptr + size; - trc->nodemap.init(); + if (!trc->nodemap.init()) + return; /* Create the root node. */ trc->curnode = MakeNode(trc, NULL, JSGCTraceKind(0));