From d0177e305a332b404b69dfe0b3093a0af1d51dcc Mon Sep 17 00:00:00 2001 From: Volker Reichelt Date: Fri, 21 Jan 2005 23:52:49 +0000 Subject: [PATCH] re PR libstdc++/19510 ([3.3 only] Uninitialized pointers in iterators) PR libstdc++/19510 * include/bits/stl_list.h (_List_iterator_base): Initialize _M_node in constructor. (_List_iterator): Initialize _List_iterator_base in constructor. * include/bits/stl_tree.h (_Rb_tree_iterator): Initialize _M_node in constructor. From-SVN: r94048 --- libstdc++-v3/ChangeLog | 9 +++++++++ libstdc++-v3/include/bits/stl_list.h | 4 +++- libstdc++-v3/include/bits/stl_tree.h | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 6611ca3aaee8..64a4bb876dd3 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2005-01-22 Volker Reichelt + + PR libstdc++/19510 + * include/bits/stl_list.h (_List_iterator_base): Initialize _M_node + in constructor. + (_List_iterator): Initialize _List_iterator_base in constructor. + * include/bits/stl_tree.h (_Rb_tree_iterator): Initialize _M_node + in constructor. + 2004-12-03 Richard Henderson PR 17856 diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index fcba3598df24..132ae254eee2 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -1,6 +1,6 @@ // List implementation -*- C++ -*- -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -108,6 +108,7 @@ namespace std { } _List_iterator_base() + : _M_node() { } /// Walk the %list forward. @@ -156,6 +157,7 @@ namespace std { } _List_iterator() + : _List_iterator_base() { } _List_iterator(const iterator& __x) diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index 1e7fdf5db2da..0fa098be1702 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -1,6 +1,6 @@ // RB tree implementation -*- C++ -*- -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -191,7 +191,7 @@ namespace std typedef _Rb_tree_iterator<_Val, _Ref, _Ptr> _Self; typedef _Rb_tree_node<_Val>* _Link_type; - _Rb_tree_iterator() {} + _Rb_tree_iterator() { _M_node = 0; } _Rb_tree_iterator(_Link_type __x) { _M_node = __x; } _Rb_tree_iterator(const iterator& __it) { _M_node = __it._M_node; } -- 2.47.2