Index: src/arm/assembler-arm.cc |
diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc |
index 2cc173cf37bd938f0b12bc59b3379c52b0cd8976..1fcd0843264e2b1ad3126d76f77b9007d7e71a11 100644 |
--- a/src/arm/assembler-arm.cc |
+++ b/src/arm/assembler-arm.cc |
@@ -4881,7 +4881,14 @@ void Assembler::GrowBuffer() { |
} else { |
desc.buffer_size = buffer_size_ + 1*MB; |
} |
- CHECK_GT(desc.buffer_size, 0); // no overflow |
+ |
+ // Some internal data structures overflow for very large buffers, |
+ // they must ensure that kMaximalBufferSize is not too large. |
+ if (desc.buffer_size > kMaximalBufferSize || |
+ static_cast<size_t>(desc.buffer_size) > |
+ isolate_data().max_old_generation_size_) { |
+ V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); |
+ } |
// Set up new buffer. |
desc.buffer = NewArray<byte>(desc.buffer_size); |