diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 9071a676..cbc4d1a9 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. @@ -44,7 +44,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -55,7 +55,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v3 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -69,4 +69,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/github-ci.yml b/.github/workflows/github-ci.yml index b83443e5..f7f05d9c 100644 --- a/.github/workflows/github-ci.yml +++ b/.github/workflows/github-ci.yml @@ -18,35 +18,31 @@ jobs: matrix: include: # GCC builds - - {os: ubuntu-latest, compiler: gcc, version: '10', + - {os: ubuntu-latest, compiler: gcc, version: '13', build_type: Release, hash_type: fasthash } - - {os: ubuntu-latest, compiler: gcc, version: '11', + - {os: ubuntu-latest, compiler: gcc, version: '14', build_type: Release, hash_type: xxhash } - - {os: ubuntu-latest, compiler: gcc, version: '12', + - {os: ubuntu-latest, compiler: gcc, version: '15', build_type: Release, hash_type: fasthash } - - {os: ubuntu-latest, compiler: gcc, version: '10', + - {os: ubuntu-latest, compiler: gcc, version: '13', build_type: Debug, hash_type: xxhash, flags: '-O0 -fno-inline --coverage', coverage: true} - - {os: ubuntu-latest, compiler: gcc, version: '10', + - {os: ubuntu-latest, compiler: gcc, version: '13', build_type: Debug, hash_type: xxhash, sanitizer: true, flags: '-fsanitize=address -fsanitize=leak -fsanitize=undefined -fsanitize-address-use-after-scope -fno-omit-frame-pointer', - ld_flags: '-fsanitize=address -fsanitize=leak -fsanitize=undefined -fsanitize=address-use-after-scope -fno-omit-frame-pointer'} + ld_flags: '-fsanitize=address -fsanitize=leak -fsanitize=undefined -fsanitize-address-use-after-scope -fno-omit-frame-pointer'} # Clang builds - - {os: ubuntu-20.04, compiler: clang, version: '10', + - {os: ubuntu-latest, compiler: clang, version: '16', build_type: Release, hash_type: xxhash } - - {os: ubuntu-latest, compiler: clang, version: '11', + - {os: ubuntu-latest, compiler: clang, version: '17', build_type: Release, hash_type: fasthash } - - {os: ubuntu-latest, compiler: clang, version: '12', + - {os: ubuntu-latest, compiler: clang, version: '18', build_type: Release, hash_type: xxhash } - - {os: ubuntu-latest, compiler: clang, version: '13', + - {os: ubuntu-latest, compiler: clang, version: '19', build_type: Release, hash_type: fasthash } - - {os: ubuntu-latest, compiler: clang, version: '14', - build_type: Release, hash_type: xxhash } - # Windows builds - - {os: windows-2019, compiler: msvc, - build_type: Release, hash_type: xxhash } + # Windows builds (removed windows-2019 as it's deprecated) - {os: windows-latest, compiler: msvc, build_type: Release, hash_type: xxhash } @@ -54,47 +50,38 @@ jobs: - {os: macos-latest, compiler: clang, build_type: Release, hash_type: xxhash } - # This seems to trigger a bug, so re-enable it after it is - # fixed - # - {os: macos-latest, compiler: clang, - # build_type: Release, hash_type: xxhash, - # flags: '-O0 -fno-inline --coverage', coverage: true} - fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup environment run: | echo "SANITIZER=${{ matrix.sanitizer }}" >> ${GITHUB_ENV} - name: Install gcc if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'gcc' run: | - sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y sudo apt-get update - sudo apt-get install g++-${{ matrix.version }} + sudo apt-get install g++-${{ matrix.version }} -y echo "CXX=g++-${{ matrix.version }}" >> ${GITHUB_ENV} echo "CC=gcc-${{ matrix.version }}" >> ${GITHUB_ENV} - name: Install clang if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'clang' run: | sudo apt-get update - sudo apt-get install libunwind-dev + sudo apt-get install libunwind-dev -y sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - version=${{ matrix.version }} - if [[ $version -ge 13 ]]; then - sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-$version main" + if [[ $version -ge 14 ]]; then + sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-$version main" -y fi sudo apt-get update - sudo apt-get install clang-$version lld libc++-$version-dev libc++abi-$version-dev + sudo apt-get install clang-$version lld libc++-$version-dev libc++abi-$version-dev -y echo "CC=clang-$version" >> ${GITHUB_ENV} echo "CXX=clang++-$version" >> ${GITHUB_ENV} - echo "CC=clang-$version" >> ${GITHUB_ENV} echo "LDFLAGS=-fuse-ld=lld" >> ${GITHUB_ENV} - - name: Initialize MSVC ${{ matrix.version }} + - name: Initialize MSVC if: startsWith(matrix.os, 'windows-') uses: ilammy/msvc-dev-cmd@v1 - with: - toolset: ${{ matrix.version }} - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type @@ -111,7 +98,7 @@ jobs: - name: Coverage if: matrix.coverage == true run: | - sudo apt-get install lcov + sudo apt-get install lcov -y CXX=g++-${{ matrix.version }} scripts/collect-coverage.sh - name: Coveralls Upload diff --git a/include/velocypack/Buffer.h b/include/velocypack/Buffer.h index 71d7b9f3..b1f12080 100644 --- a/include/velocypack/Buffer.h +++ b/include/velocypack/Buffer.h @@ -132,7 +132,7 @@ class Buffer { return *this; } - ~Buffer() { + virtual ~Buffer() { if (_buffer != _local) { velocypack_free(_buffer); } @@ -194,7 +194,7 @@ class Buffer { // Steal external memory; only allowed when the buffer is not local, // i.e. !usesLocalMemory() - T* steal() noexcept { + virtual T* steal() noexcept { VELOCYPACK_ASSERT(!usesLocalMemory()); auto buffer = _buffer; @@ -284,7 +284,7 @@ class Buffer { inline void poison(T*, ValueLength) noexcept {} #endif - void grow(ValueLength len) { + virtual void grow(ValueLength len) { VELOCYPACK_ASSERT(_size + len >= sizeof(_local)); // need reallocation