Re: [Stlport-devel] vector's insert/resize not throwing?
Brought to you by:
complement
From: Ulrich E. <eck...@sa...> - 2008-06-02 14:18:41
|
On Tuesday 27 May 2008, Ulrich Eckhardt wrote: > I'm currently stumbling across the problem that a vector is being resized > but instead of the allocator throwing, it simply returns null. The calling > code assumes that the returned pointer is non-null and happily starts > writing to an invalid memory location. I have another patch which I'd like to propose for inclusion in stl/config/_msvc.h: #if defined(UNDER_CE) /* All eVCs up to at least VC8/CE5 have a broken new operator that returns null instead of throwing bad_alloc. */ # define _STLP_NEW_DONT_THROW_BAD_ALLOC 1 #endif AFAICT, this is the main reason why STLport's workaround for broken new implementations doesn't work under CE, it is simply not used. This change requires both a recompile of STLport and client code using it, so I guess it's for 5.2 only. Uli -- Sator Laser GmbH Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932 ************************************************************************************** Visit our website at <http://www.satorlaser.de/> ************************************************************************************** Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden. E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Sator Laser GmbH ist für diese Folgen nicht verantwortlich. ************************************************************************************** |