libswoc: bound Vectray fixed span by element count (#13808)

* libswoc: bound Vectray fixed span by element count

FixedStore::span() returned all N inline slots instead of the _count
constructed ones. begin()/end() and range-for walked past the last
element, and ~FixedStore() ran destructors on slots that were never
constructed, which is undefined behavior for non-trivial T.

The existing tests only used N=1 filled to capacity, where N equals
_count, so the bug never showed. Upstream libswoc has the same code.

* Split Vectray partially filled store tests

The iteration check and the destructor check cover separate effects
of the span() bug. As separate test cases, a crash in the destructor
check is not reported against the iteration check, and each name
says what it covers.

* Name Vectray span tests by the behavior checked
2 files changed
tree: 4be0188a21ff773dffc754348f3f8ec1f79bceb6
  1. .agents/
  2. .github/
  3. .idea/
  4. code/
  5. doc/
  6. example/
  7. tools/
  8. unit_tests/
  9. .clang-format
  10. .gitignore
  11. CMakeLists.txt
  12. LICENSE
  13. Makefile
  14. Pipfile
  15. README.md
  16. Sconstruct
README.md

libswoc

Solid Wall of C++ Library. Documentation.

Versioning

  • Point release - Backwards compatible change that requires only a recompilation.
  • Minor release - Backwards compatible change that requires trivial / obvious code changes to preserve the same functionality / semantics. E.g. a method name change.
  • Major release - Semantic changes that require restructuring or redesign of client code.