1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Improved ce handling of failed irCodeGen, const null ptr handling

This commit is contained in:
Brian Fiete 2025-05-27 11:52:34 +02:00
parent 2f66bcafcc
commit e82f9ce3ee
3 changed files with 57 additions and 12 deletions

View file

@ -149,11 +149,22 @@ int ChunkedDataBuffer::GetReadPos()
}
void ChunkedDataBuffer::SetReadPos(int pos)
{
{
mReadPoolIdx = pos / ALLOC_SIZE;
mReadCurAlloc = mPools[mReadPoolIdx];
mReadCurPtr = mReadCurAlloc + pos % ALLOC_SIZE;
mReadNextAlloc = mReadCurPtr + ALLOC_SIZE;
if (mReadPoolIdx < mPools.mSize)
{
mReadCurAlloc = mPools[mReadPoolIdx];
mReadCurPtr = mReadCurAlloc + pos % ALLOC_SIZE;
mReadNextAlloc = mReadCurPtr + ALLOC_SIZE;
}
else
{
// Place at end of last pool
mReadPoolIdx = mPools.mSize - 1;
mReadCurAlloc = mPools[mReadPoolIdx];
mReadCurPtr = mReadCurAlloc + ALLOC_SIZE;
mReadNextAlloc = mReadCurPtr;
}
}
void ChunkedDataBuffer::NextReadPool()