dlang-community / libdparse

Library for lexing and parsing D source code
https://libdparse.dlang.io
Boost Software License 1.0
115 stars 57 forks source link

Change RollbackAllocator.Node.contains to exclusive end #381

Closed WebFreak001 closed 4 years ago

WebFreak001 commented 4 years ago

This fixes an issue in rollback(point) that the assert(contains(point)) would not error out but then it would crash eventually because first becomes null while recursively checking the contains.

Before it would keep deallocating even when the memory point we have is right outside the allocated memory region.

This shouldn't introduce any side effects as contains is only used in the rollback_allocator module and now it would simply assert out instead of segfaulting out.

(got libdparse to segfault in the rollback call in parseFunctionBody and this changes it to an assert fail but I'm still searching for the reason why it is invalid in the first place)

WebFreak001 commented 4 years ago

sorry this is garbage, gonna add unittests and fix the current implementation of allocate rather