Index: runtime/vm/snapshot.cc |
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc |
index d9249db1d39e92b68cd45b38f272bac9b389c73b..6bce49759d8c85b5d296bb4135e99689163bdbab 100644 |
--- a/runtime/vm/snapshot.cc |
+++ b/runtime/vm/snapshot.cc |
@@ -596,8 +596,10 @@ RawApiError* SnapshotReader::VerifyVersion() { |
Version::SnapshotString(), |
actual_version); |
free(actual_version); |
- const String& msg = String::Handle(String::New(message_buffer)); |
- return ApiError::New(msg); |
+ // This can also fail while bringing up the VM isolate, so make sure to |
+ // allocate the error message in old space. |
+ const String& msg = String::Handle(String::New(message_buffer, Heap::kOld)); |
+ return ApiError::New(msg, Heap::kOld); |
} |
Advance(version_len); |
return ApiError::null(); |