Allow the write when the buffer can fit the event exactly
authorAndrew Au <andrewau@microsoft.com>
Fri, 17 May 2019 21:29:00 +0000 (14:29 -0700)
committerAndrew Au <cshung@gmail.com>
Sat, 18 May 2019 04:39:24 +0000 (21:39 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/4d4d411dceb28c89bcd61b1fe41b5fb7a2af896b

src/coreclr/src/vm/eventpipebuffer.cpp
src/coreclr/src/vm/eventpipebuffer.h

index 091e87e..6d453b1 100644 (file)
@@ -74,7 +74,7 @@ bool EventPipeBuffer::WriteEvent(Thread *pThread, EventPipeSession &session, Eve
     unsigned int eventSize = sizeof(EventPipeEventInstance) + payload.GetSize();
     
     // Make sure we have enough space to write the event.
-    if(m_pCurrent + eventSize >= m_pLimit)
+    if(m_pCurrent + eventSize > m_pLimit)
     {
         return false;
     }
index fc0fa62..3e6bb7a 100644 (file)
@@ -118,7 +118,7 @@ private:
     FORCEINLINE BYTE* GetNextAlignedAddress(BYTE *pAddress)
     {
         LIMITED_METHOD_CONTRACT;
-        _ASSERTE(m_pBuffer <= pAddress && m_pLimit > pAddress);
+        _ASSERTE(m_pBuffer <= pAddress && pAddress <= m_pLimit);
 
         pAddress = (BYTE*)ALIGN_UP(pAddress, AlignmentSize);