diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-12-14 16:15:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-14 16:15:49 -0500 |
commit | 5d91c4d2cc8fe60bad20cdfdf2e5f239bc024061 (patch) | |
tree | 3e0876f0720be5d0842780301339dfc33e7a99f1 | |
parent | 7f8496d99627f2a8bf9d7bbbc07d601c431a1a6c (diff) | |
download | coreclr-5d91c4d2cc8fe60bad20cdfdf2e5f239bc024061.tar.gz coreclr-5d91c4d2cc8fe60bad20cdfdf2e5f239bc024061.tar.bz2 coreclr-5d91c4d2cc8fe60bad20cdfdf2e5f239bc024061.zip |
Change non-exclusive Check postconditions to null checks (#15523)
The Check macro is trying to be helpful and trigger DebugBreak when the condition
is false and debugger is attached. It makes it hard to exercise the recent jump stub
changes with debugger attached. The fix is to change the non-exclusive Check postconditions
to a simple null check.
-rw-r--r-- | src/vm/codeman.cpp | 8 | ||||
-rw-r--r-- | src/vm/dynamicmethod.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/vm/codeman.cpp b/src/vm/codeman.cpp index b1e67469ff..2fe8b140ef 100644 --- a/src/vm/codeman.cpp +++ b/src/vm/codeman.cpp @@ -2099,7 +2099,7 @@ HeapList* LoaderCodeHeap::CreateCodeHeap(CodeHeapRequestInfo *pInfo, LoaderHeap CONTRACT(HeapList *) { THROWS; GC_NOTRIGGER; - POSTCONDITION(CheckPointer(RETVAL) || !pInfo->getThrowOnOutOfMemoryWithinRange()); + POSTCONDITION((RETVAL != NULL) || !pInfo->getThrowOnOutOfMemoryWithinRange()); } CONTRACT_END; size_t * pPrivatePCLBytes = NULL; @@ -2303,7 +2303,7 @@ HeapList* EEJitManager::NewCodeHeap(CodeHeapRequestInfo *pInfo, DomainCodeHeapLi THROWS; GC_NOTRIGGER; PRECONDITION(m_CodeHeapCritSec.OwnedByCurrentThread()); - POSTCONDITION(CheckPointer(RETVAL) || !pInfo->getThrowOnOutOfMemoryWithinRange()); + POSTCONDITION((RETVAL != NULL) || !pInfo->getThrowOnOutOfMemoryWithinRange()); } CONTRACT_END; size_t initialRequestSize = pInfo->getRequestSize(); @@ -2422,7 +2422,7 @@ void* EEJitManager::allocCodeRaw(CodeHeapRequestInfo *pInfo, THROWS; GC_NOTRIGGER; PRECONDITION(m_CodeHeapCritSec.OwnedByCurrentThread()); - POSTCONDITION(CheckPointer(RETVAL) || !pInfo->getThrowOnOutOfMemoryWithinRange()); + POSTCONDITION((RETVAL != NULL) || !pInfo->getThrowOnOutOfMemoryWithinRange()); } CONTRACT_END; pInfo->setRequestSize(header+blockSize+(align-1)+pInfo->getReserveForJumpStubs()); @@ -2897,7 +2897,7 @@ JumpStubBlockHeader * EEJitManager::allocJumpStubBlock(MethodDesc* pMD, DWORD n GC_NOTRIGGER; PRECONDITION(loAddr < hiAddr); PRECONDITION(pLoaderAllocator != NULL); - POSTCONDITION(CheckPointer(RETVAL) || !throwOnOutOfMemoryWithinRange); + POSTCONDITION((RETVAL != NULL) || !throwOnOutOfMemoryWithinRange); } CONTRACT_END; _ASSERTE((sizeof(JumpStubBlockHeader) % CODE_SIZE_ALIGN) == 0); diff --git a/src/vm/dynamicmethod.cpp b/src/vm/dynamicmethod.cpp index aa9b73e2ff..c997565fb1 100644 --- a/src/vm/dynamicmethod.cpp +++ b/src/vm/dynamicmethod.cpp @@ -322,7 +322,7 @@ HeapList* HostCodeHeap::CreateCodeHeap(CodeHeapRequestInfo *pInfo, EEJitManager GC_NOTRIGGER; MODE_ANY; INJECT_FAULT(COMPlusThrowOM()); - POSTCONDITION(CheckPointer(RETVAL) || !pInfo->getThrowOnOutOfMemoryWithinRange()); + POSTCONDITION((RETVAL != NULL) || !pInfo->getThrowOnOutOfMemoryWithinRange()); } CONTRACT_END; |