Closed charlesgregory closed 2 years ago
weird that this wasn't caught by unit tests, which run in debug mode, no?
Actually I can't recreate the issue and dhtslib.vcf.writer
has 100% coverage. Must have been some quirk when updating dhtslib
downstream. Closing for now.
Actually found it, doesn't block compilation has an assert thrown at runtime. It's not the invariant
actually the ctor
that's incorrect at line 61 VCFHeader *
should be VCFHeader
. Since using a VCFHeader
doesn't trigger either of the static if
blocks the header goes uninitialized.
https://github.com/blachlylab/dhtslib/blob/0f284df0d57f973fb0a0e2b96af059d59bfb8975/source/dhtslib/vcf/writer.d#L54-L63
It isn't caught by our unittests as all our unittests don't supply either a bcf_hdr_t*
or a VCFHeader
as input. The default ctor that isn't supplied some form of header will just call bcf_hdr_init
.
VCFWriter
invariant
block is incorrect and blocks compilation indebug
mode.https://github.com/blachlylab/dhtslib/blob/0f284df0d57f973fb0a0e2b96af059d59bfb8975/source/dhtslib/vcf/writer.d#L65-L68