Chromium Code Reviews| Index: runtime/vm/class_table.cc |
| =================================================================== |
| --- runtime/vm/class_table.cc (revision 35144) |
| +++ runtime/vm/class_table.cc (working copy) |
| @@ -89,6 +89,10 @@ |
| class_heap_stats_table_ = new_stats_table; |
| } |
| ASSERT(top_ < capacity_); |
| + if (!Class::is_valid_id(top_)) { |
| + FATAL1("Fatal error in ClassTable::Register: invalid index %" Pd "\n", |
|
Ivan Posva
2014/04/18 16:39:27
FATAL is OK for now, but we really should just thr
|
| + top_); |
| + } |
| cls.set_id(top_); |
| table_[top_] = cls.raw(); |
| top_++; // Increment next index. |
| @@ -102,7 +106,7 @@ |
| if (index >= capacity_) { |
| // Grow the capacity of the class table. |
| intptr_t new_capacity = index + capacity_increment_; |
| - if (new_capacity < capacity_) { |
| + if (!Class::is_valid_id(index) || new_capacity < capacity_) { |
| FATAL1("Fatal error in ClassTable::Register: invalid index %" Pd "\n", |
| index); |
| } |