HomePhabricator

Merge #12770: Use explicit casting in cuckoocache's compute_hashes(...) to…

Description

Merge #12770: Use explicit casting in cuckoocache's compute_hashes(...) to clarify integer conversion

Summary:
9142dfea81 Use explicit casting in cuckoocache's compute_hashes(...) to clarify integer conversion (practicalswift)

Pull request description:

Use explicit casting in cuckoocache's `compute_hashes(...)` to clarify integer conversion.

I discussed this code with the code's author @JeremyRubin who suggested patching it to avoid any confusion.

At least one static analyzer incorrectly warns about a shift past bitwidth (UB) here, so this patch will help avoid confusion for human reviewers and static analyzers alike :-)

Tree-SHA512: 0419ee31b422d2ffedbd1a100688ec0ff5b0c1690d6d92592f638ca8db07a21a9650cb467923108c6f14a38d2bf07d6e6c85d2d1d4b7da53ffe6919f94f32655

Backport of Core PR12770
https://github.com/bitcoin/bitcoin/pull/12770/

Test Plan:

make check
test_runner.py

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D3932

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Apr 9 2018, 12:06
nakihitoCommitted on Aug 23 2019, 19:27
FabienPushed on Aug 26 2019, 09:42
Reviewer
Restricted Owners Package
Differential Revision
D3932: Merge #12770: Use explicit casting in cuckoocache's compute_hashes(...) to clarify integer conversion
Parents
rSTAGING546d8973648a: Merge #12561: Check for block corruption in ConnectBlock()
Branches
Unknown
Tags
Unknown