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

Unified Diff: runtime/vm/object_reload.cc

Issue 2474193002: During a reload, give const fields their new values. (Closed)
Patch Set: Created 4 years, 1 month 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/isolate_reload_test.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_reload.cc
diff --git a/runtime/vm/object_reload.cc b/runtime/vm/object_reload.cc
index f3b06e0da26669dc82984adeb761b7dabc6f1db6..0429adfcff87cf511223b620800fe736faf5ae5a 100644
--- a/runtime/vm/object_reload.cc
+++ b/runtime/vm/object_reload.cc
@@ -128,7 +128,9 @@ void Class::CopyStaticFieldValues(const Class& old_cls) const {
old_field = Field::RawCast(old_field_list.At(j));
old_name = old_field.name();
if (name.Equals(old_name)) {
- if (update_values) {
+ // We only copy values if requested and if the field is not a const
+ // field. We let const fields be updated with a reload.
+ if (update_values && !field.is_const()) {
value = old_field.StaticValue();
field.SetStaticValue(value);
}
« no previous file with comments | « runtime/vm/isolate_reload_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698