Chromium Code Reviews| Index: runtime/bin/gen_snapshot.cc |
| diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc |
| index 2f19fb23f8f0eccfbdbfb5505c73206177fb827b..82bf5ddec1f5e52dd22bf4191bb693e781e9b5b1 100644 |
| --- a/runtime/bin/gen_snapshot.cc |
| +++ b/runtime/bin/gen_snapshot.cc |
| @@ -544,18 +544,18 @@ int main(int argc, char** argv) { |
| // Initialize the Dart VM. |
| // Note: We don't expect isolates to be created from dart code during |
| // snapshot generation. |
| - if (!Dart_Initialize(NULL, |
| - NULL, NULL, NULL, NULL, |
| - DartUtils::OpenFile, |
| - DartUtils::ReadFile, |
| - DartUtils::WriteFile, |
| - DartUtils::CloseFile, |
| - DartUtils::EntropySource)) { |
| - Log::PrintErr("VM initialization failed\n"); |
| + char* error = Dart_Initialize(NULL, NULL, NULL, NULL, NULL, |
| + DartUtils::OpenFile, |
| + DartUtils::ReadFile, |
| + DartUtils::WriteFile, |
| + DartUtils::CloseFile, |
| + DartUtils::EntropySource); |
| + if (error != NULL) { |
| + Log::PrintErr("VM initialization failed: %s\n", error); |
| + free(error); |
|
Ivan Posva
2015/08/17 13:35:51
This can lead to problems if the embedder and the
zra
2015/08/18 06:23:14
Filed: https://github.com/dart-lang/sdk/issues/241
|
| return 255; |
| } |
| - char* error; |
| Dart_Isolate isolate = Dart_CreateIsolate( |
| NULL, NULL, NULL, NULL, NULL, &error); |
| if (isolate == NULL) { |