Skip to content

Commit b55ac6b

Browse files
committed
ci: enable ASan on GCC
1 parent 35e14c9 commit b55ac6b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
standards: '20'
4242
latest-factors: |
4343
msvc Optimized-Debug
44-
gcc UBSan Coverage
44+
gcc UBSan ASan Coverage
4545
clang UBSan ASan
4646
apple-clang UBSan ASan
4747
factors: ''
@@ -77,10 +77,11 @@ jobs:
7777
llvm-archive-extension: {{#if (ieq os 'windows') }}7z{{else}}tar.bz2{{/if}}
7878
llvm-archive-filename: {{{ llvm-archive-basename }}}.{{{ llvm-archive-extension }}}
7979
llvm-sanitizer-config: {{#if (and (ne compiler 'clang') (ne compiler 'apple-clang'))}}{{else if ubsan}}Undefined{{else if asan}}Address{{else if msan}}MemoryWithOrigins{{/if}}
80+
asan-options: {{#if (and (eq compiler 'gcc') asan) }}detect_container_overflow=0{{/if}}
8081
mrdocs-flags: {{#if (and (eq compiler 'gcc') (not asan)) }}-static{{/if}}{{#if (and (eq compiler 'clang') msan) }}-fsanitize-memory-track-origins{{/if}}
8182
mrdocs-ccflags: {{{ ccflags }}} {{{ mrdocs-flags }}}
8283
mrdocs-cxxflags: {{{ cxxflags }}} {{{ mrdocs-flags }}}
83-
mrdocs-linkflags: {{#if asan }}-fsanitize=address{{/if}}
84+
mrdocs-linkflags: {{#if asan }}-fsanitize=address{{/if}}{{#if (and (eq compiler 'gcc') asan) }}-fsanitize=leak{{/if}}
8485
mrdocs-package-generators: {{#if (ieq os 'windows') }}7Z ZIP WIX{{else}}TGZ TXZ{{/if}}
8586
mrdocs-release-package-artifact: release-packages-{{{ lowercase os }}}
8687
output-file: matrix.json
@@ -375,6 +376,8 @@ jobs:
375376

376377
- name: CMake Workflow
377378
uses: alandefreitas/cpp-actions/[email protected]
379+
env:
380+
ASAN_OPTIONS: ${{ matrix.asan-options }}
378381
with:
379382
cmake-version: '>=3.26'
380383
cxxstd: ${{ matrix.cxxstd }}

0 commit comments

Comments
 (0)