From 1ced7c8dc30154c0064a9ae6dc64cbeaa169e6d6 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Wed, 8 Nov 2023 19:41:13 -0500 Subject: [PATCH] Minor tweaks --- src/platform/dwarf.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/platform/dwarf.hpp b/src/platform/dwarf.hpp index c574450..c8a6ee4 100644 --- a/src/platform/dwarf.hpp +++ b/src/platform/dwarf.hpp @@ -81,9 +81,8 @@ namespace libdwarf { } die_object& operator=(die_object&& other) noexcept { - dbg = other.dbg; - die = other.die; - other.die = nullptr; + std::swap(dbg, other.dbg); + std::swap(die, other.die); return *this; } @@ -252,6 +251,7 @@ namespace libdwarf { } template + // callback should return true to keep going void dwarf5_ranges(F callback) const { Dwarf_Attribute attr = nullptr; if(wrap(dwarf_attr, die, DW_AT_ranges, &attr) != DW_DLV_OK) { @@ -330,6 +330,7 @@ namespace libdwarf { } template + // callback should return true to keep going void dwarf4_ranges(Dwarf_Addr lowpc, F callback) const { Dwarf_Attribute attr = nullptr; if(wrap(dwarf_attr, die, DW_AT_ranges, &attr) != DW_DLV_OK) { @@ -377,6 +378,7 @@ namespace libdwarf { } template + // callback should return true to keep going void dwarf_ranges(int version, optional pc, F callback) const { Dwarf_Addr lowpc = std::numeric_limits::max(); if(wrap(dwarf_lowpc, die, &lowpc) == DW_DLV_OK) {