Page MenuHomePhabricator

util: Add Assert identity function
ClosedPublic

Authored by Fabien on Dec 1 2020, 09:49.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC41441cb8ee36: util: Add Assert identity function
Summary
The utility function is primarily useful to dereference pointer types,
which are known to be not null at that time.

For example, the ArgsManager is known to exist when the wallets are
started:
https://github.com/bitcoin/bitcoin/pull/18923/files#diff-fdb2a1a1d8bc790fcddeb6cf5a42ac55R503
. Instead of silently relying on that assumption, Assert can be used to
abort the program and avoid UB should the assumption ever be violated.

Backport of core PR19277.

Depends on D8565.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable