Index: src/codegen.h |
=================================================================== |
--- src/codegen.h (revision 4341) |
+++ src/codegen.h (working copy) |
@@ -229,7 +229,12 @@ |
Label entry_label_; |
Label exit_label_; |
- int registers_[RegisterAllocator::kNumRegisters]; |
+ // C++ doesn't allow zero length arrays, so we make the array length 1 even |
+ // if we don't need it. |
+ static const int kRegistersArrayLength = |
+ (RegisterAllocator::kNumRegisters == 0) ? |
+ 1 : RegisterAllocator::kNumRegisters; |
+ int registers_[kRegistersArrayLength]; |
#ifdef DEBUG |
const char* comment_; |