Open
Bug 556701
Opened 15 years ago
Updated 2 years ago
STL: Review exception safety of <vector> on gcc and MSVC
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
NEW
People
(Reporter: cjones, Unassigned)
References
(Blocks 1 open bug)
Details
No description provided.
Comment 1•14 years ago
|
||
/usr/include/c++/4.2.1/stl_vector.h:767 has a try/catch block. Is that safe?
Reporter | ||
Comment 2•14 years ago
|
||
Yes. The block is attempting to catch std::bad_alloc, but (i) try/catch are ignored in -fno-exceptions; (ii) Gecko overrides ::operator new() (which std::allocator uses) with an implementation that never throws bad_alloc.
Comment 3•14 years ago
|
||
Then I can confirm that <vector> is safe for gcc 4.2.1 (on mac, but I don't expect the header to be different on linux).
Do we need to look at other gcc versions as well?
Comment 4•14 years ago
|
||
I can also confirm the safety of the <vector> header on MSVC 2008.
Reporter | ||
Comment 5•14 years ago
|
||
<vector> changed a fair amount in 4.4. Not sure about 4.5.
Comment 6•14 years ago
|
||
I also checked the gcc libstd++ trunk source, and it looks good to me. This <http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/libsupc%2B%2B/exception_defines.h?view=markup> makes me much happier as well. :-)
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•