This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/17012] std::list's function, remove, looks like it is reading memory that has been freed.


------- Additional Comments From chris at bubblescope dot net  2005-07-05 12:11 -------
It seems to me that this is just a simple NAB. There seems to be 3 options
1) Just leave it as is
2) Alter list::remove so in debug mode it aborts if you give it an element from the list
3) Alter list::remove so this code works (which in some very quick checking seems to produce about a 
~15% slowdown on things like list<int>s)

The similar problem on things in <algorithm> I think is more cut (if you pass something by reference to 
an algorithm, that algorithm shouldn't change it, clearly). This could still perhaps be made clearer in the 
standard...

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17012


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]