Re: [Quickfix-developers] r1491: nasty bug in Exception class
Brought to you by:
orenmnero
|
From: Ajay K. <Aja...@tr...> - 2006-06-02 21:45:22
|
I suppose you are referring to the bug that the Exception ctor is calling detail.size() before detail itself is constructed. -----Original Message----- From: Caleb Epstein [mailto:cal...@gm...]=20 Sent: Friday, June 02, 2006 5:37 PM To: quickfix-developers Subject: [Quickfix-developers] r1491: nasty bug in Exception class QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX Support: http://www.quickfixengine.org/services.html The Exception class constructor has a nasty bug. Can you spot it? /// Base QuickFIX exception type. struct Exception : public std::logic_error { Exception( const std::string& t, const std::string& d ) : std::logic_error( detail.size() ? t + ": " + d : t ), type( t ), detail( d ) {} std::string type; std::string detail; }; SPOILER: The ternary operator is using the "detail" class member, but it hasn't been constructed yet! Boom! --=20 Caleb Epstein _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers -------------------------------------------------------------------------= -- The information in this email is confidential and may be legally = privileged. It is intended solely for the addressee. Access to this email by anyone = else is unauthorized. If you are not the intended recipient, any disclosure, = copying, distribution or any action taken or omitted to be taken in reliance on = it, is prohibited and may be unlawful. TradeWeb reserves the right to monitor and review the content of all = messages sent to or from this e-mail address. Messages sent to or from this e-mail = address may be stored on the TradeWeb e-mail system. |