diff options
author | stephentoub <stoub@microsoft.com> | 2015-05-28 15:02:40 -0400 |
---|---|---|
committer | stephentoub <stoub@microsoft.com> | 2015-05-29 10:22:20 -0400 |
commit | 8ea3a0b51afb9afc6a7896c6b47f96a56b9968e8 (patch) | |
tree | 9f766b617e4b803f95279b9817d3e4b8f579c135 | |
parent | 1767614904d0b9d8054ea1d53c3b22eeb62a680c (diff) | |
download | coreclr-8ea3a0b51afb9afc6a7896c6b47f96a56b9968e8.tar.gz coreclr-8ea3a0b51afb9afc6a7896c6b47f96a56b9968e8.tar.bz2 coreclr-8ea3a0b51afb9afc6a7896c6b47f96a56b9968e8.zip |
Fix exitCode from ExecuteAssembly
ExecuteAssembly is initializing exitCode to 0 on entrance to the function. If it then fails prior to exitCode being set when invoking the entry point, the exitCode remains 0 even though there was a failure, and corerun ends up returning a successful exit code.
-rw-r--r-- | src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp | 1 | ||||
-rw-r--r-- | src/dlls/mscoree/unixinterface.cpp | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp b/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp index e7323c177a..4f6ffa0330 100644 --- a/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp +++ b/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp @@ -290,6 +290,7 @@ int ExecuteManagedAssembly( if (!SUCCEEDED(st)) { fprintf(stderr, "ExecuteAssembly failed - status: 0x%08x\n", st); + exitCode = -1; } } else diff --git a/src/dlls/mscoree/unixinterface.cpp b/src/dlls/mscoree/unixinterface.cpp index 2eaa1b81cb..1cd9d679b8 100644 --- a/src/dlls/mscoree/unixinterface.cpp +++ b/src/dlls/mscoree/unixinterface.cpp @@ -124,7 +124,11 @@ HRESULT ExecuteAssembly( LPCSTR entryPointMethodName, DWORD* exitCode) { - *exitCode = 0; + if (exitCode == NULL) + { + return HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER); + } + *exitCode = -1; DWORD error = PAL_InitializeCoreCLR(exePath, coreClrPath, true); HRESULT hr = HRESULT_FROM_WIN32(error); |