Skip to content

Commit

Permalink
SimpleHeapAllocator bug when splitting blocks allowed memory overrun.
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Nov 21, 2024
1 parent f3bf9eb commit 22f7faf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/std/core/allocators/heap_allocator.c3
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn void*! SimpleHeapAllocator._alloc(&self, usz bytes) @local
return current + 1;
case current.size > aligned_bytes:
Header* unallocated = (Header*)((char*)current + aligned_bytes + Header.sizeof);
unallocated.size = current.size - aligned_bytes;
unallocated.size = current.size - aligned_bytes - Header.sizeof;
unallocated.next = current.next;
if (current == self.free_list)
{
Expand Down
1 change: 1 addition & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Fix issue with overloaded subscript and ++/--.
- Fix issue with properties in different targets not being respected #1633.
- Indexing an Optional slice would crash in codegen #1636.
- SimpleHeapAllocator bug when splitting blocks allowed memory overrun.

### Stdlib changes
- Add `io::MultiReader`, `io::MultiWriter`, and `io::TeeReader` structs.
Expand Down

0 comments on commit 22f7faf

Please sign in to comment.