#3311 closed Bugs (fixed)
Unintentionally unthrown exceptions
Reported by: | Owned by: | Jonathan Turkanis | |
---|---|---|---|
Milestone: | Boost 1.40.0 | Component: | iostreams |
Version: | Boost 1.39.0 | Severity: | Problem |
Keywords: | Cc: | Gareth Sylvester-Bradley <gareth.sylvester-bradley@…> |
Description
In several places, Boost.Iostreams creates exception objects but doesn't throw them, which I assume is unintentional, and appears to have the potential to result in incorrect behaviour.
Using bad_seek() and bad_write() -
https://svn.boost.org/trac/boost/browser/tags/release/Boost_1_39_0/boost/iostreams/detail/restrict_impl.hpp#L163 https://svn.boost.org/trac/boost/browser/tags/release/Boost_1_39_0/boost/iostreams/detail/restrict_impl.hpp#L184 https://svn.boost.org/trac/boost/browser/tags/release/Boost_1_39_0/boost/iostreams/detail/restrict_impl.hpp#L188 https://svn.boost.org/trac/boost/browser/tags/release/Boost_1_39_0/boost/iostreams/detail/restrict_impl.hpp#L275 https://svn.boost.org/trac/boost/browser/tags/release/Boost_1_39_0/boost/iostreams/detail/restrict_impl.hpp#L296 https://svn.boost.org/trac/boost/browser/tags/release/Boost_1_39_0/boost/iostreams/detail/restrict_impl.hpp#L300
Using BOOST_IOSTREAMS_FAILURE() directly -
These all seem to be present in trunk as well...
The patch seems trivial; introduce "throw" in all these places...
(In [57603]) Fix unthrown exceptions. Refs #3311.
Thanks to Gareth Sylvester-Bradley and Richard Smith.