Order of initialization for ASN.1 decoders

This commit is contained in:
Jeffrey Walton 2018-04-06 02:29:08 -04:00
parent 62a9574f3f
commit 64a15cf51b
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 2 additions and 9 deletions

View File

@ -502,14 +502,12 @@ lword BERGeneralDecoder::ReduceLength(lword delta)
}
DERGeneralEncoder::DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag)
: ByteQueue(), m_outQueue(outQueue), m_finished(false), m_asnTag(asnTag)
: ByteQueue(), m_outQueue(outQueue), m_asnTag(asnTag), m_finished(false)
{
}
// TODO: GCC (and likely other compilers) identify this as a copy constructor; and not a constructor.
// We have to wait until Crypto++ 6.0 to fix it because the signature change breaks versioning.
DERGeneralEncoder::DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag)
: ByteQueue(), m_outQueue(outQueue), m_finished(false), m_asnTag(asnTag)
: ByteQueue(), m_outQueue(outQueue), m_asnTag(asnTag), m_finished(false)
{
}

5
asn.h
View File

@ -283,11 +283,6 @@ private:
lword ReduceLength(lword delta);
};
// GCC (and likely other compilers) identify the explicit DERGeneralEncoder as a copy constructor;
// and not a constructor. We had to remove the default asnTag value to point the compiler in the
// proper direction. We did not break the library or versioning based on the output of
// `nm --demangle libcryptopp.a | grep DERGeneralEncoder::DERGeneralEncoder | grep -v " U "`.
/// \brief DER General Encoder
class CRYPTOPP_DLL DERGeneralEncoder : public ByteQueue
{