From f7146b5af9b85dbaee0c2bdd76ea7230daf30aad Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Sun, 2 Nov 2025 18:41:09 +0100 Subject: [PATCH] CI updates --- .github/workflows/ci.yml | 3 ++- src/util/xspan_impl_common.h | 10 ++++++---- src/util/xspan_impl_ptr.h | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e86fe37..6ae190d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,7 @@ jobs: apt-get update && apt-get upgrade -y # install system packages apt-get install -y --no-install-recommends bash ca-certificates curl git libmpc3 make perl-base python3-minimal tar time xz-utils libc6:i386 zlib1g:i386 + apt-get install -y gcc-riscv64-linux-gnu mkdir ../deps; cd ../deps; mkdir packages ### install python2-minimal packages from Debian-11 ## curl -sS -L -O https://ftp.debian.org/debian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8+deb11u1_amd64.deb @@ -292,10 +293,10 @@ jobs: include: # NOTE: Xcode updates regularly tend to break Homebrew clang/gcc; often some ld64 issue; use "xcode_version" as needed; or try "-Wl,-ld_classic" # NOTE: macos does not have "env -C"; only with brew coreutils - - { os: macos-13, gcc: gcc-12, gxx: g++-12, testsuite: true } - { os: macos-14, gcc: gcc-13, gxx: g++-13, testsuite: true } - { os: macos-15, gcc: gcc-14, gxx: g++-14, testsuite: true } - { os: macos-26, gcc: gcc-15, gxx: g++-15, testsuite: true } + - { os: macos-15-intel, gcc: gcc-14, gxx: g++-14, testsuite: true } name: ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} runs-on: ${{ matrix.os }} steps: diff --git a/src/util/xspan_impl_common.h b/src/util/xspan_impl_common.h index c6d2276c..78d3a2d6 100644 --- a/src/util/xspan_impl_common.h +++ b/src/util/xspan_impl_common.h @@ -119,6 +119,7 @@ forceinline ~CSelf() noexcept {} size_in_bytes = 0; assertInvariants(); } + // constructors from pointers CSelf(pointer first, XSpanCount count) : ptr(makePtr(first)), base(makeBase(first)), @@ -177,6 +178,7 @@ forceinline ~CSelf() noexcept {} makeNotNull((pointer) membuffer_get_void_ptr(mb))) {} CSelf(std::nullptr_t, MemBuffer &) XSPAN_DELETED_FUNCTION; #endif + // disable constructors from nullptr to catch compile-time misuse private: CSelf(std::nullptr_t, XSpanCount) XSPAN_DELETED_FUNCTION; @@ -404,7 +406,7 @@ public: } private: - pointer check_deref(pointer p) const { + pointer check_deref(pointer p) const may_throw { assertInvariants(); if __acc_cte (!configRequirePtr && p == nullptr) xspan_fail_nullptr(); @@ -412,7 +414,7 @@ private: xspan_check_range(p, base, size_in_bytes - sizeof(T)); return p; } - pointer check_deref(pointer p, ptrdiff_t n) const { + pointer check_deref(pointer p, ptrdiff_t n) const may_throw { assertInvariants(); if __acc_cte (!configRequirePtr && p == nullptr) xspan_fail_nullptr(); @@ -422,7 +424,7 @@ private: xspan_check_range(p, base, size_in_bytes - sizeof(T)); return p; } - pointer check_add(pointer p, ptrdiff_t n) const { + pointer check_add(pointer p, ptrdiff_t n) const may_throw { assertInvariants(); if __acc_cte (!configRequirePtr && p == nullptr) xspan_fail_nullptr(); @@ -442,7 +444,7 @@ public: // raw access pointer raw_base() const noexcept { return base; } size_type raw_size_in_bytes() const noexcept { return size_in_bytes; } - pointer raw_bytes(size_t bytes) const { + pointer raw_bytes(size_t bytes) const may_throw { assertInvariants(); if (bytes > 0) { if __acc_cte (!configRequirePtr && ptr == nullptr) diff --git a/src/util/xspan_impl_ptr.h b/src/util/xspan_impl_ptr.h index 234d7603..8583e11d 100644 --- a/src/util/xspan_impl_ptr.h +++ b/src/util/xspan_impl_ptr.h @@ -80,6 +80,7 @@ public: ptr_invalidate_and_poison(ptr); // point to non-null invalid address assertInvariants(); } + inline CSelf() { assertInvariants(); } // constructors from pointers @@ -132,7 +133,6 @@ public: } // comparison - bool operator==(pointer other) const noexcept { return ptr == other; } template XSPAN_REQUIRES_CONVERTIBLE_R(bool) @@ -204,7 +204,7 @@ private: public: // raw access pointer raw_ptr() const noexcept { return ptr; } - pointer raw_bytes(size_t bytes) const { + pointer raw_bytes(size_t bytes) const may_throw { assertInvariants(); if (bytes > 0) { if very_unlikely (ptr == nullptr)