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

Unified Diff: runtime/vm/heap_profiler.cc

Issue 12473002: Complete implementation of bounds checking in the vm, by introducing a vm object (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap_profiler.cc
===================================================================
--- runtime/vm/heap_profiler.cc (revision 19513)
+++ runtime/vm/heap_profiler.cc (working copy)
@@ -208,11 +208,17 @@
const RawClass* HeapProfiler::GetSuperClass(const RawClass* raw_class) {
ASSERT(raw_class != Class::null());
- const RawType* super_type = raw_class->ptr()->super_type_;
- if (super_type == Type::null()) {
+ const RawAbstractType* super_type = raw_class->ptr()->super_type_;
+ if (super_type == AbstractType::null()) {
return Class::null();
}
- return reinterpret_cast<const RawClass*>(super_type->ptr()->type_class_);
+ while (super_type->GetClassId() == kBoundedTypeCid) {
+ super_type =
+ reinterpret_cast<const RawBoundedType*>(super_type)->ptr()->type_;
+ }
+ ASSERT(super_type->GetClassId() == kTypeCid);
+ return reinterpret_cast<const RawClass*>(
+ reinterpret_cast<const RawType*>(super_type)->ptr()->type_class_);
}
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698