HomePhabricator

Fix a bug in blockencoding_tests

Description

Fix a bug in blockencoding_tests

Summary:
This has been revealed by enabling the glibc++ assertions (-Wp,-D_GLIBCXX_ASSERTIONS) and running a static libstdc++ build, which happens to be the case when running the ArchLinux package builds.

Once exposed the issue is obvious, accessing an object from an out of bound vector. This doesn't cause any issue because hte memory is not freed/overriden and the vector clear() method just shrinks the capacity, but the standard lib can detect the issue.

Test Plan:

CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" cmake -GNinja .. -DENABLE_STATIC_LIBSTDCXX=ON
ninja all check

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
FabienAuthored on Apr 28 2023, 11:34
FabienPushed on Apr 28 2023, 13:46
Reviewer
Restricted Project
Differential Revision
D13818: Fix a bug in blockencoding_tests
Parents
rABC8296d02abafa: build: MacOS toolchain bump
Branches
Unknown
Tags
Unknown