mirror of
https://github.com/taglib/taglib.git
synced 2026-11-05 22:18:50 -05:00
ByteVector, List: Check indices if the standard library does (#1467)
If the standard library checks the index in std::vector::operator[] (_GLIBCXX_ASSERTIONS, libc++ hardening modes), ByteVector::operator[] and List::operator[] now check the index against their own size and abort if it is out of range, as std::vector does. The std::vector check alone is not enough: a ByteVector created by mid() shares the buffer of the original byte vector, so an index past the end of the smaller vector still passes it. List::operator[] walks a std::list, which these checks do not cover. Builds without these macros are unchanged; a GCC Release build of libtag produces identical code. The Ubuntu CI job now builds with -D_GLIBCXX_ASSERTIONS so that the tests run with the checks enabled.
This commit is contained in:
@@ -11,6 +11,8 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest, windows-2025, ubuntu-26.04]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
cmake_extra_args: '-DCMAKE_CXX_FLAGS="-D_GLIBCXX_ASSERTIONS"'
|
||||
- os: windows-latest
|
||||
cmake_extra_args: '-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"'
|
||||
- os: windows-2025
|
||||
|
||||
Reference in New Issue
Block a user