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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 1850653003: Provide ability to patch external functions in a class that has already been finalized. The follow… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review Created 4 years, 9 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 | « no previous file | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 1a256cd8da20a8af2a8b55b80ca91ba520bc9f94..9497eab2d2e9625a4a653be9878863461c2c4339 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -2427,7 +2427,12 @@ void ClassFinalizer::FinalizeTypesInClass(const Class& cls) {
// fields because type parameters are parsed before the class body. Since
// 'ResolveAndFinalizeMemberTypes(cls)' has not been called yet, unfinalized
// member types could choke the snapshotter.
- ASSERT(Array::Handle(cls.functions()).Length() == 0);
+ // Or
+ // if the class is being refinalized because a patch is being applied
+ // after the class has been finalized then it is ok for the class to have
+ // functions.
+ ASSERT((Array::Handle(cls.functions()).Length() == 0) ||
+ cls.is_refinalize_after_patch());
}
}
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698