| Index: runtime/bin/platform.cc
|
| diff --git a/runtime/bin/platform.cc b/runtime/bin/platform.cc
|
| index ec75ee97cb3d9e0e11216b62d0acb6f92dd539eb..f2f16befee58e56ea0bb3cd8ad3397c553958efb 100644
|
| --- a/runtime/bin/platform.cc
|
| +++ b/runtime/bin/platform.cc
|
| @@ -45,12 +45,28 @@ void FUNCTION_NAME(Platform_LocalHostname)(Dart_NativeArguments args) {
|
|
|
| void FUNCTION_NAME(Platform_ExecutableName)(Dart_NativeArguments args) {
|
| ASSERT(Platform::GetExecutableName() != NULL);
|
| + if (Dart_IsRunningPrecompiledCode()) {
|
| + // This is a work-around to be able to use most of the existing test suite
|
| + // for precompilation. Many tests do something like Process.run(
|
| + // Platform.executable, some_other_script.dart). But with precompilation
|
| + // the script is already fixed, so the spawned process runs the same script
|
| + // again and we have a fork-bomb.
|
| + Dart_ThrowException(Dart_NewStringFromCString(
|
| + "Platform.executable not supported under precompilation"));
|
| + UNREACHABLE();
|
| + }
|
| Dart_SetReturnValue(
|
| args, Dart_NewStringFromCString(Platform::GetExecutableName()));
|
| }
|
|
|
|
|
| void FUNCTION_NAME(Platform_ResolvedExecutableName)(Dart_NativeArguments args) {
|
| + if (Dart_IsRunningPrecompiledCode()) {
|
| + Dart_ThrowException(Dart_NewStringFromCString(
|
| + "Platform.resolvedExecutable not supported under precompilation"));
|
| + UNREACHABLE();
|
| + }
|
| +
|
| if (Platform::GetResolvedExecutableName() != NULL) {
|
| Dart_SetReturnValue(
|
| args, Dart_NewStringFromCString(Platform::GetResolvedExecutableName()));
|
|
|