Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 5003e7e1123010340703167e50e3252ce2356933..9b59bcb80b9f43accbde84511898107e10f4da56 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -10551,6 +10551,18 @@ void Library::AllocatePrivateKey() const { |
Zone* zone = thread->zone(); |
Isolate* isolate = thread->isolate(); |
+ if (isolate->IsReloading()) { |
+ // When reloading, we need to make sure we use the original private key |
+ // if this library previously existed. |
+ IsolateReloadContext* reload_context = isolate->reload_context(); |
+ const String& original_key = |
+ String::Handle(reload_context->FindLibraryPrivateKey(*this)); |
+ if (!original_key.IsNull()) { |
+ StorePointer(&raw_ptr()->private_key_, original_key.raw()); |
siva
2016/06/13 19:49:56
How do you ensure that there is no collision betwe
Cutch
2016/06/13 19:55:38
Presently we don't. I wonder if we should go back
|
+ return; |
+ } |
+ } |
+ |
// Format of the private key is: "@<sequence number><6 digits of hash> |
const intptr_t hash_mask = 0x7FFFF; |