From 9302d0e83762ee2888cbf921dfbe5f9a8540971f Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Mon, 1 Feb 2016 13:41:03 -0800 Subject: Fix Unix build breaks [tfs-changeset: 1571015] --- src/vm/corhost.cpp | 3 +-- src/vm/excep.cpp | 9 +++++++-- src/vm/securitypolicy.cpp | 10 +++++----- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/vm/corhost.cpp b/src/vm/corhost.cpp index 648708fac3..2a7cf45249 100644 --- a/src/vm/corhost.cpp +++ b/src/vm/corhost.cpp @@ -3109,8 +3109,7 @@ STDMETHODIMP CorHost2::UnloadAppDomain(DWORD dwDomainId, BOOL fWaitUntilDone) else { _ASSERTE(!"Not reachable"); -#pragma prefast(suppress:33021, "This code is not reacheble so this assignment is fine.") - hr = FALSE; + hr = S_FALSE; } } END_ENTRYPOINT_NOTHROW; diff --git a/src/vm/excep.cpp b/src/vm/excep.cpp index e8a17d4262..b2bb6663aa 100644 --- a/src/vm/excep.cpp +++ b/src/vm/excep.cpp @@ -4979,8 +4979,11 @@ BOOL InstallUnhandledExceptionFilter() { // register UEF for SL. if (g_pOriginalUnhandledExceptionFilter == FILTER_NOT_INSTALLED) { -#pragma prefast(suppress:28725, "Calling to SetUnhandledExceptionFilter is intentional in this case.") + #pragma prefast(push) + #pragma prefast(suppress:28725, "Calling to SetUnhandledExceptionFilter is intentional in this case.") g_pOriginalUnhandledExceptionFilter = SetUnhandledExceptionFilter(COMUnhandledExceptionFilter); + #pragma prefast(pop) + // make sure is set (ie. is not our special value to indicate unset) LOG((LF_EH, LL_INFO10, "InstallUnhandledExceptionFilter registered UEF with OS for CoreCLR!\n")); } @@ -5015,8 +5018,10 @@ void UninstallUnhandledExceptionFilter() { // We will be here only for CoreCLR on WLC or on Mac SL. if (g_pOriginalUnhandledExceptionFilter != FILTER_NOT_INSTALLED) { -#pragma prefast(suppress:28725, "Calling to SetUnhandledExceptionFilter is intentional in this case.") + #pragma prefast(push) + #pragma prefast(suppress:28725, "Calling to SetUnhandledExceptionFilter is intentional in this case.") SetUnhandledExceptionFilter(g_pOriginalUnhandledExceptionFilter); + #pragma prefast(pop) g_pOriginalUnhandledExceptionFilter = FILTER_NOT_INSTALLED; LOG((LF_EH, LL_INFO10, "UninstallUnhandledExceptionFilter unregistered UEF from OS for CoreCLR!\n")); diff --git a/src/vm/securitypolicy.cpp b/src/vm/securitypolicy.cpp index a0cf676417..082be54f88 100644 --- a/src/vm/securitypolicy.cpp +++ b/src/vm/securitypolicy.cpp @@ -724,16 +724,16 @@ size_t SecurityPolicy::GetLongPathNameHelper( const WCHAR* wszShortPath, __inout if (index == 0) break; - #ifdef _PREFAST_ + #ifdef _PREFAST_ #pragma prefast(push) #pragma prefast(disable:26001, "suppress prefast warning about underflow by doing index-1 which is checked above.") - #endif // _PREFAST_ - + #endif // _PREFAST_ + wszIntermediateBuffer[index-1] = W('\0'); - #ifdef _PREFAST_ + #ifdef _PREFAST_ #pragma prefast(pop) - #endif + #endif size = WszGetLongPathName(wszIntermediateBuffer, wszBuffer, MAX_LONGPATH); -- cgit v1.2.3