Fix undefined behaviors caught by ubsan

This fixes a couple of integer overflows in parsing as well as removes
the construction of a null reference that never got dereferenced.
This also initializes the bool members in TCall
Finally, this adds a UBSAN run alongside ASAN and TSAN in CI.
This commit is contained in:
arcady-lunarg 2024-07-15 19:10:42 -04:00 committed by GitHub
parent 702026e3f5
commit 48eaea60b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 5 deletions

View file

@ -51,7 +51,7 @@ jobs:
matrix:
compiler: [{cc: gcc, cxx: g++}]
cmake_build_type: [Debug]
flags: ['-fsanitize=address', '-fsanitize=thread']
flags: ['-fsanitize=address', '-fsanitize=thread', '-fsanitize=undefined']
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: lukka/get-cmake@983956e4a5edce90f0dfcc38c1543077e668402b # v3.30.0
@ -82,8 +82,12 @@ jobs:
- name: Install
run: cmake --install build --prefix build/install
- name: Test
env:
UBSAN_OPTIONS: 'halt_on_error=1:print_stacktrace=1'
run: ctest --output-on-failure --test-dir build
- name: Test (standalone)
env:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1
run: cd Test && ./runtests
# Ensure we can compile/run on an older distro