From 64a15cf51b8f1868d1b076d4efa6154aba0bc963 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 6 Apr 2018 02:29:08 -0400 Subject: [PATCH] Order of initialization for ASN.1 decoders --- asn.cpp | 6 ++---- asn.h | 5 ----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/asn.cpp b/asn.cpp index fb7740b4..5d5cdaa5 100644 --- a/asn.cpp +++ b/asn.cpp @@ -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) { } diff --git a/asn.h b/asn.h index b3c71629..30620f5d 100644 --- a/asn.h +++ b/asn.h @@ -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 {