Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions .github/workflows/sanitize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,17 @@ env:

jobs:
build:
name: ${{ matrix.config.name }}
name: ${{ matrix.sanitizer.name }} (${{ matrix.compiler.cc }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {
name: "Address Sanitizer",
sanitize: "address",
cc: "gcc", cxx: "g++"
}
- {
name: "Undefined Behavior Sanitizer",
sanitize: "undefined,float-cast-overflow",
cc: "clang", cxx: "clang++"
}
sanitizer:
- { name: "Address Sanitizer", flags: "address" }
- { name: "Undefined Behavior Sanitizer", flags: "undefined,float-cast-overflow" }
compiler:
- { cc: "gcc", cxx: "g++" }
- { cc: "clang", cxx: "clang++" }
env:
UBSAN_OPTIONS: print_stacktrace=1

Expand All @@ -38,9 +33,9 @@ jobs:
persist-credentials: false
- name: Configure
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
run: cmake -B build -S . -DSANITIZE=${{ matrix.config.sanitize }}
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
run: cmake -B build -S . -DSANITIZE=${{ matrix.sanitizer.flags }}
- name: Build C++ unit tests
run: cmake --build build --config Release
- name: Run C++ tests
Expand Down
4 changes: 2 additions & 2 deletions common/include/memory_operations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ static inline void check_memory_size(size_t requested_index, size_t capacity) {

// note: size is in bytes, not items
static inline size_t copy_from_mem(const void* src, void* dst, size_t size) {
memcpy(dst, src, size);
if (size > 0) memcpy(dst, src, size);
return size;
}

// note: size is in bytes, not items
static inline size_t copy_to_mem(const void* src, void* dst, size_t size) {
memcpy(dst, src, size);
if (size > 0) memcpy(dst, src, size);
return size;
}

Expand Down
Loading