From 8ea3a0b51afb9afc6a7896c6b47f96a56b9968e8 Mon Sep 17 00:00:00 2001 From: stephentoub Date: Thu, 28 May 2015 15:02:40 -0400 Subject: 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. --- src/dlls/mscoree/unixinterface.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/dlls') 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); -- cgit v1.2.3