From d94690b537f8f83fead41cfb6a2594f045e9569d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 14 Jul 2020 00:28:56 +0100 Subject: fix(3p/nix/libexpr): Fix post-increment operator in BindingsIterator We accidentally returned the incremented iterator in the post-increment, this fixes it. Paired-With: Luke Granger-Brown Paired-With: Vincent Ambo Paired-With: Perry Lorier Change-Id: I36c79eb56359bb12a78ad3489e7d7d2eb2053510 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1140 Tested-by: BuildkiteCI Reviewed-by: lukegb Reviewed-by: glittershark --- third_party/nix/src/libexpr/attr-set.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'third_party/nix') diff --git a/third_party/nix/src/libexpr/attr-set.cc b/third_party/nix/src/libexpr/attr-set.cc index c5cfbf3caf5f..5ef63a129cdc 100644 --- a/third_party/nix/src/libexpr/attr-set.cc +++ b/third_party/nix/src/libexpr/attr-set.cc @@ -23,12 +23,13 @@ BindingsIterator& BindingsIterator::operator++() { } BindingsIterator BindingsIterator::operator++(int) { + auto old = *this; std::visit(util::overloaded{ [](AttributeMap::iterator& iter) { iter++; }, [](AttributeVector::iterator& iter) { iter++; }, }, _iterator); - return *this; + return old; } bool BindingsIterator::operator==(const BindingsIterator& other) const { -- cgit 1.4.1