Skip to content

Conversation

@rodentrabies
Copy link
Contributor

This is fix for #25640.

(bool)coin.IsCoinBase());
(uint32_t)it->second.coin.nHeight,
(int64_t)it->second.coin.out.nValue,
(bool)it->second.coin.IsCoinBase());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

An alternative would be to move the TRACE5 call before the std::move.

@0xB10C
Copy link
Contributor

0xB10C commented Jul 29, 2022

ACK f8e2284

Changes look good. Ran the functional usdt interface tests (with the commits from #25528 cherry-picked). This branch is currently running in the CI here https://cirrus-ci.com/build/4542423555637248.

@maflcko maflcko merged commit f5eadcb into bitcoin:master Aug 1, 2022
@rodentrabies rodentrabies deleted the bugprone-use-after-move branch August 1, 2022 09:41
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Aug 1, 2022
…ViewCache::AddCoin`

f8e2284 tracing: do not use `coin` after move in `CCoinsViewCache::AddCoin` (Seibart Nedor)

Pull request description:

  This is fix for bitcoin#25640.

ACKs for top commit:
  0xB10C:
    ACK f8e2284

Tree-SHA512: e7643ac8e6b6247aaf250f44572c4b458da4aea030ac0268227564e6857200e9c23efe325cfc535f46498cbeccaf46301551efeeb54b062f71d2dcf1ffe71fb8
fanquake added a commit to fanquake/bitcoin that referenced this pull request Aug 30, 2022
Will error with:
```bash
coins.cpp:102:22: error: 'coin' used after it was moved [bugprone-use-after-move,-warnings-as-errors]
           (uint32_t)coin.nHeight,
                     ^
coins.cpp:96:21: note: move occurred here
    it->second.coin = std::move(coin);
```

until bitcoin#25663 is merged.

See:
https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone-use-after-move.html
@bitcoin bitcoin locked and limited conversation to collaborators Aug 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracing: coins.cpp:102:22: error: 'coin' used after it was moved [bugprone-use-after-move]

4 participants