]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarf_edit vs _GLIBCXX_DEBUG
authorRoland McGrath <roland@redhat.com>
Wed, 21 Jul 2010 22:35:11 +0000 (15:35 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 21 Jul 2010 22:35:11 +0000 (15:35 -0700)
libdw/ChangeLog
libdw/c++/dwarf_ref_maker

index e3645bb0e3beecae57590d222f274a34a4795740..13492f9df2b9860ad2869926f38c71dddc716296 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-21  Roland McGrath  <roland@redhat.com>
+
+       * c++/dwarf_ref_maker (dwarf_ref_maker::seen): Add copy constructor
+       to avoid default copying of uninitialized iterator.
+
 2010-07-13  Roland McGrath  <roland@redhat.com>
 
        * c++/dwarf_comparator (dwarf_tracker_base): Replace visit method with
index cfb6c4a10ec77353568fd808bb31a22c67c44ac7..f7c7fdbbe0d9886b8f61293c98d2c62e42472020 100644 (file)
@@ -1,5 +1,5 @@
 /* elfutils::dwarf_ref_maker -- -*- C++ -*- template type specification
-   Copyright (C) 2009 Red Hat, Inc.
+   Copyright (C) 2009-2010 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -109,6 +109,15 @@ namespace elfutils
        : _m_known (false), _m_out (), _m_refs ()
       {}
 
+      // Copy construction only valid for initial state.
+      inline seen (const seen &other)
+       : _m_known (false), _m_out (), _m_refs ()
+      {
+       if (unlikely (other._m_known) || unlikely (!other._m_refs.empty ()))
+         throw std::logic_error
+           ("seen copy constructs only from default-constructed");
+      }
+
       inline void resolve ()
       {
        for (; !_m_refs.empty (); _m_refs.pop_back ())