mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[vm] Check for OOM when allocating a new handle block.
Bug: https://github.com/dart-lang/sdk/issues/32706 Change-Id: I0159d794e11c18f24204d11d9ba3bbfe8a5a4140 Reviewed-on: https://dart-review.googlesource.com/48706 Reviewed-by: Siva Annamalai <asiva@google.com> Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
865f52737a
commit
3dcdaf9e57
|
@ -156,7 +156,11 @@ void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
|
|||
CountScopedHandles());
|
||||
}
|
||||
if (scoped_blocks_->next_block() == NULL) {
|
||||
scoped_blocks_->set_next_block(new HandlesBlock(NULL));
|
||||
HandlesBlock* block = new HandlesBlock(NULL);
|
||||
if (block == NULL) {
|
||||
OUT_OF_MEMORY();
|
||||
}
|
||||
scoped_blocks_->set_next_block(block);
|
||||
}
|
||||
scoped_blocks_ = scoped_blocks_->next_block();
|
||||
scoped_blocks_->set_next_handle_slot(0);
|
||||
|
@ -203,7 +207,9 @@ void Handles<kHandleSizeInWords, kHandlesPerChunk, kOffsetOfRawPtr>::
|
|||
CountScopedHandles());
|
||||
}
|
||||
zone_blocks_ = new HandlesBlock(zone_blocks_);
|
||||
ASSERT(zone_blocks_ != NULL);
|
||||
if (zone_blocks_ == NULL) {
|
||||
OUT_OF_MEMORY();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
|
|
Loading…
Reference in a new issue