Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 29c473933d8d086dfeba67be46614f7850eae603..60e35500e4ab80adfbce2746a66d2f1e9fb84e4a 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -10676,7 +10676,10 @@ void Library::AllocatePrivateKey() const { |
OS::SNPrint(private_key, sizeof(private_key), |
"%c%" Pd "%06" Pd "", |
kPrivateKeySeparator, sequence_value, hash_value); |
- StorePointer(&raw_ptr()->private_key_, String::New(private_key, Heap::kOld)); |
+ const String& key = String::Handle(zone, String::New(private_key, |
+ Heap::kOld)); |
+ key.Hash(); // This string may end up in the VM isolate. |
+ StorePointer(&raw_ptr()->private_key_, key.raw()); |
} |