From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25393 invoked by alias); 5 Jul 2005 12:11:15 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 25350 invoked by uid 48); 5 Jul 2005 12:11:11 -0000 Date: Tue, 05 Jul 2005 12:11:00 -0000 Message-ID: <20050705121111.25348.qmail@sourceware.org> From: "chris at bubblescope dot net" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040812195652.17012.debrak@sgi.com> References: <20040812195652.17012.debrak@sgi.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libstdc++/17012] std::list's function, remove, looks like it is reading memory that has been freed. X-Bugzilla-Reason: CC X-SW-Source: 2005-07/txt/msg00417.txt.bz2 List-Id: ------- 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 lists) The similar problem on things in 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