Page MenuHomePhabricator

Prevent UB in DeleteLock() function
ClosedPublic

Authored by deadalnix on Sep 22 2020, 18:00.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABC8b4530e45434: Prevent UB in DeleteLock() function
Summary
  • refactor: Add LockStackItem type alias
  • refactor: Add LockPair type alias
  • refactor: Refactor duplicated code into LockHeld()
  • Replace thread_local g_lockstack with a mutex-protected map

This change prevents UB in case of early g_lockstack destroying.

Co-authored-by: Wladimir J. van der Laan <laanwj@protonmail.com>

  • doc: Add and fix comments about never destroyed objects

This is a backport of Core PR18881

Test Plan
ninja all check-all

Also in debug mode.

Diff Detail

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

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Sep 22 2020, 19:12