From 42943c2391b6134b4caf5ff78e35c0c9edc57661 Mon Sep 17 00:00:00 2001 From: jimblandy Date: Wed, 25 Aug 2010 15:10:19 +0000 Subject: Breakpad DWARF parser: Don't use auto_ptr > where stack would do. Perhaps there once was some reason one needed the DIE offset stack to have an unusual lifetime, but there is none now. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@666 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/dwarf/dwarf2reader.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index 23f7ffa8..2c15ece6 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -39,7 +39,6 @@ #include #include -#include #include #include @@ -494,11 +493,8 @@ void CompilationUnit::ProcessDIEs() { else lengthstart += 4; - // we need semantics of boost scoped_ptr here - no intention of trasnferring - // ownership of the stack. use const, but then we limit ourselves to not - // ever being able to call .reset() on the smart pointer. - std::auto_ptr > const die_stack(new stack); - + stack die_stack; + while (dieptr < (lengthstart + header_.length)) { // We give the user the absolute offset from the beginning of // debug_info, since they need it to deal with ref_addr forms. @@ -510,8 +506,8 @@ void CompilationUnit::ProcessDIEs() { // Abbrev == 0 represents the end of a list of children. if (abbrev_num == 0) { - const uint64 offset = die_stack->top(); - die_stack->pop(); + const uint64 offset = die_stack.top(); + die_stack.pop(); handler_->EndDIE(offset); continue; } @@ -525,7 +521,7 @@ void CompilationUnit::ProcessDIEs() { } if (abbrev.has_children) { - die_stack->push(absolute_offset); + die_stack.push(absolute_offset); } else { handler_->EndDIE(absolute_offset); } -- cgit v1.2.1