Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: runtime/vm/object.h

Issue 243133004: Check for class id overflow to exit rather than crash. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runtime/vm/class_table.cc ('K') | « runtime/vm/class_table.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 35144)
+++ runtime/vm/object.h (working copy)
@@ -691,8 +691,12 @@
raw_ptr()->handle_vtable_ = value;
}
+ static bool is_valid_id(intptr_t value) {
+ return RawObject::ClassIdTag::is_valid(value);
+ }
intptr_t id() const { return raw_ptr()->id_; }
void set_id(intptr_t value) const {
+ ASSERT(is_valid_id(value));
raw_ptr()->id_ = value;
}
« runtime/vm/class_table.cc ('K') | « runtime/vm/class_table.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698