Skip to content

Commit

Permalink
unwind: EHABISectionIterator operator!=, constify operator-
Browse files Browse the repository at this point in the history
Add missing `operator!=` and make `operator-` const for
`EHABISectionIterator`.  This repairs the build of libunwind when
building with GCC.

Patch by Chad Duffin!

Reviewed By: compnerd, libunwind
Differential Revision: https://reviews.llvm.org/D81597
  • Loading branch information
compnerd committed Jun 18, 2020
1 parent 2474421 commit 2d865cc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libunwind/src/UnwindCursor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1275,14 +1275,20 @@ struct EHABISectionIterator {
_Self operator+(size_t a) { _Self out = *this; out._i += a; return out; }
_Self operator-(size_t a) { assert(_i >= a); _Self out = *this; out._i -= a; return out; }

size_t operator-(const _Self& other) { return _i - other._i; }
size_t operator-(const _Self& other) const { return _i - other._i; }

bool operator==(const _Self& other) const {
assert(_addressSpace == other._addressSpace);
assert(_sects == other._sects);
return _i == other._i;
}

bool operator!=(const _Self& other) const {
assert(_addressSpace == other._addressSpace);
assert(_sects == other._sects);
return _i != other._i;
}

typename A::pint_t operator*() const { return functionAddress(); }

typename A::pint_t functionAddress() const {
Expand Down

0 comments on commit 2d865cc

Please sign in to comment.