Page MenuHomePhabricator

Merge #14510: Avoid triggering undefined behaviour in base_uint<BITS>::bits()
ClosedPublic

Authored by markblundeberg on May 27 2019, 14:31.

Details

Summary

PR14510 backport https://github.com/bitcoin/bitcoin/pull/14510/files
96f6dc9fc50b1cc59e26d50940ebf46e1bdcc0ba Avoid triggering undefined behaviour in base_uint<BITS>::bits() (practicalswift)

Pull request description:

Avoid triggering undefined behaviour in `base_uint<BITS>::bits()`.

`1 << 31` is undefined behaviour in C++11.

Given the reasonable assumption of `sizeof(int) * CHAR_BIT == 32`.
Test Plan

make check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
patch
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6007
Build 10073: Bitcoin ABC Buildbot (legacy)
Build 10072: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.May 27 2019, 14:34