Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 5fdc2cb

Browse files
Bug 864462 - Fix OOM in write barrier verifier (r=terrence)
1 parent bf7451d commit 5fdc2cb

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

js/src/gc/Verifier.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,12 +509,13 @@ gc::StartVerifyPreBarriers(JSRuntime *rt)
509509

510510
const size_t size = 64 * 1024 * 1024;
511511
trc->root = (VerifyNode *)js_malloc(size);
512-
JS_ASSERT(trc->root);
512+
if (!trc->root)
513+
goto oom;
513514
trc->edgeptr = (char *)trc->root;
514515
trc->term = trc->edgeptr + size;
515516

516517
if (!trc->nodemap.init())
517-
return;
518+
goto oom;
518519

519520
/* Create the root node. */
520521
trc->curnode = MakeNode(trc, NULL, JSGCTraceKind(0));
@@ -525,7 +526,8 @@ gc::StartVerifyPreBarriers(JSRuntime *rt)
525526
/* Make all the roots be edges emanating from the root node. */
526527
MarkRuntime(trc);
527528

528-
VerifyNode *node = trc->curnode;
529+
VerifyNode *node;
530+
node = trc->curnode;
529531
if (trc->edgeptr == trc->term)
530532
goto oom;
531533

0 commit comments

Comments
 (0)