Assert that we don't try to have an ArenaBlock depend on itself.
It introduces a cycle in the `next` pointers in the ArenaBlockRef's, which results in infinite recursion as we follow them in `getTotalSize`. This doesn't fix the underlying problem, but gives a better failure than a stack overflow.
This commit is contained in:
parent
c489dbcb26
commit
2a8f5c7c3c
|
@ -297,6 +297,7 @@ void* ArenaBlock::make4kAlignedBuffer(uint32_t size) {
|
|||
}
|
||||
|
||||
void ArenaBlock::dependOn(Reference<ArenaBlock>& self, ArenaBlock* other) {
|
||||
ASSERT(self->getData() != other->getData());
|
||||
other->addref();
|
||||
if (!self || self->isTiny() || self->unused() < sizeof(ArenaBlockRef))
|
||||
create(SMALL, self)->makeReference(other);
|
||||
|
|
Loading…
Reference in New Issue