Index: runtime/vm/object_reload.cc |
diff --git a/runtime/vm/object_reload.cc b/runtime/vm/object_reload.cc |
index 046333438cb6f655df89e1730501f5610f1865ed..726e18fdaadfb3438ff11b82052428a331b14466 100644 |
--- a/runtime/vm/object_reload.cc |
+++ b/runtime/vm/object_reload.cc |
@@ -232,7 +232,10 @@ void Class::ReplaceEnum(const Class& old_enum) const { |
String& enum_ident = String::Handle(); |
Instance& old_enum_value = Instance::Handle(zone); |
Instance& enum_value = Instance::Handle(zone); |
- |
+ // The E.values array. |
+ Instance& old_enum_values = Instance::Handle(zone); |
+ // The E.values array. |
+ Instance& enum_values = Instance::Handle(zone); |
Array& enum_map_storage = Array::Handle(zone, |
HashTables::New<UnorderedHashMap<EnumMapTraits> >(4)); |
ASSERT(!enum_map_storage.IsNull()); |
@@ -251,6 +254,7 @@ void Class::ReplaceEnum(const Class& old_enum) const { |
continue; |
} |
if (enum_ident.Equals(Symbols::Values())) { |
+ old_enum_values = field.StaticValue(); |
// Non-enum instance. |
continue; |
} |
@@ -279,6 +283,7 @@ void Class::ReplaceEnum(const Class& old_enum) const { |
continue; |
} |
if (enum_ident.Equals(Symbols::Values())) { |
+ enum_values = field.StaticValue(); |
// Non-enum instance. |
continue; |
} |
@@ -302,6 +307,11 @@ void Class::ReplaceEnum(const Class& old_enum) const { |
enum_map_storage = enum_map.Release().raw(); |
} |
+ // Map the old E.values array to the new E.values array. |
+ ASSERT(!old_enum_values.IsNull()); |
+ ASSERT(!enum_values.IsNull()); |
+ reload_context->AddEnumBecomeMapping(old_enum_values, enum_values); |
+ |
if (enums_deleted && FLAG_trace_reload_verbose) { |
// TODO(johnmccutchan): Add this to the reload 'notices' list. |
VTIR_Print("The following enum values were deleted and are forever lost in " |