Fix Unix build breaks
authorJan Kotas <jkotas@microsoft.com>
Mon, 1 Feb 2016 21:41:03 +0000 (13:41 -0800)
committerJan Kotas <jkotas@microsoft.com>
Mon, 1 Feb 2016 21:41:03 +0000 (13:41 -0800)
[tfs-changeset: 1571015]

src/vm/corhost.cpp
src/vm/excep.cpp
src/vm/securitypolicy.cpp

index 648708f..2a7cf45 100644 (file)
@@ -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;
index e8a17d4..b2bb666 100644 (file)
@@ -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"));
index a0cf676..082be54 100644 (file)
@@ -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);