Skip to content

Commit 19b9833

Browse files
authored
Fix bad deallocate for zero-length allocations in alloc.h (#118866)
1 parent 5a7ac76 commit 19b9833

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/coreclr/jit/alloc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ class CompIAllocator : public IAllocator
316316
// Frees the block of memory pointed to by p.
317317
virtual void Free(void* p) override
318318
{
319+
if (p == &m_zeroLenAllocTarg)
320+
return;
321+
319322
m_alloc.deallocate(p);
320323
}
321324
};

0 commit comments

Comments
 (0)