|
|
@@ -483,7 +483,9 @@ EmitBufferManager<TAlloc, TPreReservedAlloc, SyncObject>::CommitBuffer(TEmitBuff
|
|
|
AssertMsg(alignPad == 0, "If we are copying right now - we should be done with setting alignment.");
|
|
|
|
|
|
const DWORD bufferBytesFree(allocation->BytesFree());
|
|
|
- AnalysisAssert(currentDestBuffer + bufferBytesFree < destBuffer + destBufferBytes);
|
|
|
+ // Use <= here instead of < to allow this memcopy to fill up the rest of destBuffer. If we do, then FinalizeAllocation,
|
|
|
+ // called below, determines that no additional padding is necessary based on the values in `allocation'.
|
|
|
+ AnalysisAssert(currentDestBuffer + bufferBytesFree <= destBuffer + destBufferBytes);
|
|
|
memcpy_s(currentDestBuffer, bufferBytesFree, sourceBuffer, bytesToChange);
|
|
|
|
|
|
currentDestBuffer += bytesToChange;
|