Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index 9868346f1e297e8ec82300cc4caa3d9858616155..c25b2fc589b0f0dd05b653eadafaa2af91c89ef8 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -439,7 +439,9 @@ Dart_Isolate Api::CastIsolate(Isolate* isolate) { |
Dart_Handle Api::NewError(const char* format, ...) { |
- Isolate* isolate = Isolate::Current(); |
+ Thread* thread = Thread::Current(); |
+ Isolate* isolate = thread->isolate(); |
+ Zone* zone = thread->zone(); |
DARTSCOPE(isolate); |
CHECK_CALLBACK_STATE(isolate); |
@@ -448,13 +450,13 @@ Dart_Handle Api::NewError(const char* format, ...) { |
intptr_t len = OS::VSNPrint(NULL, 0, format, args); |
va_end(args); |
- char* buffer = isolate->current_zone()->Alloc<char>(len + 1); |
+ char* buffer = zone->Alloc<char>(len + 1); |
va_list args2; |
va_start(args2, format); |
OS::VSNPrint(buffer, (len + 1), format, args2); |
va_end(args2); |
- const String& message = String::Handle(isolate, String::New(buffer)); |
+ const String& message = String::Handle(zone, String::New(buffer)); |
return Api::NewHandle(isolate, ApiError::New(message)); |
} |