Page MenuHomePhabricator

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

Authored by nakihito on Aug 21 2019, 20:21.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR12770
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7220
Build 12485: Bitcoin ABC Buildbot (legacy)
Build 12484: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Aug 21 2019, 20:21
Fabien requested changes to this revision.Aug 22 2019, 08:14

This is a regression from C++ style casts to C style casts.

This revision now requires changes to proceed.Aug 22 2019, 08:14
This revision is now accepted and ready to land.Aug 23 2019, 14:17