Index: src/ppc/assembler-ppc.cc |
diff --git a/src/ppc/assembler-ppc.cc b/src/ppc/assembler-ppc.cc |
index ec6330a351d225f143506d9ffa96f755c0e76ad1..d3c57a479b75c89f1fca675c24ecf1602b4f3264 100644 |
--- a/src/ppc/assembler-ppc.cc |
+++ b/src/ppc/assembler-ppc.cc |
@@ -1984,7 +1984,14 @@ void Assembler::GrowBuffer(int needed) { |
if (space < needed) { |
desc.buffer_size += needed - space; |
} |
- 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); |