Page MenuHomePhabricator

Fix a bug in blockencoding_tests
ClosedPublic

Authored by Fabien on Apr 28 2023, 11:35.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC6dfadc7456ab: 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

Event Timeline

Fabien requested review of this revision.Apr 28 2023, 11:35
This revision is now accepted and ready to land.Apr 28 2023, 13:24
This revision was automatically updated to reflect the committed changes.