libdparse
libdparse copied to clipboard
Needed attributes should be required at compile-time
... by using an appropriate constructor ;-)
I just had the unpleasant experience of debugging this segfault:
Program received signal SIGSEGV, Segmentation fault.
0x00000000005b118c in dparse.rollback_allocator.RollbackAllocator.allocate(const(ulong)) (this=..., size=72)
at ../../../.dub/packages/libdparse-master/libdparse/src/dparse/rollback_allocator.d:30
30 if (first is null)
The reason is that the allocator variable in Parser is not set, an error which could be checked easily with a constructor ;-)