Skip to content

Commit

Permalink
BUGFIX: Use correct initialization range in stackalloc buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Washi1337 committed May 26, 2024
1 parent 1248bf9 commit 52ea03e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ public long Allocate(int size)
throw new ArgumentOutOfRangeException(nameof(size));

long address = AddressRange.End;
_localStorage = _localStorage.Resize(_localStorage.Count + size * 8, false);
int originalSize = _localStorage.Count;
_localStorage = _localStorage.Resize(originalSize + size * 8, false);
if (!_initializeLocals)
_localStorage.AsSpan(0, (int) (address - _baseAddress)).MarkFullyUnknown();
_localStorage.AsSpan(originalSize, _localStorage.Count - originalSize).MarkFullyUnknown();

return address;
}
Expand Down

0 comments on commit 52ea03e

Please sign in to comment.