Skip to content

Commit 08ac784

Browse files
committed
ci: add Clang ASAN/UBSAN workflow; fix unused WAV var in oac_demo
1 parent 1181ae4 commit 08ac784

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Clang/ASAN/UBSAN
2+
3+
on:
4+
push:
5+
branches: [ main, wip/** ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-test-sanitizers:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Install dependencies
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y clang llvm-dev libclang-dev build-essential autotools-dev automake autoconf libtool pkg-config
20+
21+
- name: Configure with sanitizers
22+
env:
23+
CC: clang
24+
CFLAGS: "-g -O1 -fsanitize=address,undefined -fno-omit-frame-pointer"
25+
LDFLAGS: "-fsanitize=address,undefined"
26+
run: |
27+
./autogen.sh || true
28+
./configure CC=$CC CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
29+
30+
- name: Build
31+
run: make -j$(nproc)
32+
33+
- name: Run tests
34+
run: make check -j2

src/oac_demo.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ int main(int argc, char *argv[]) {
430430
int output_wav = 0;
431431
oac_uint64 wav_data_bytes = 0;
432432
int input_wav = 0;
433-
uint32_t input_wav_data_size = 0;
434433
long input_wav_data_start = 0;
435434
int stop = 0;
436435
oac_int32 *in = NULL;
@@ -815,7 +814,6 @@ int main(int argc, char *argv[]) {
815814
}
816815
uint32_t cs = chunk[4] | (chunk[5]<<8) | (chunk[6]<<16) | (chunk[7]<<24);
817816
if (memcmp(chunk, "data", 4) == 0) {
818-
input_wav_data_size = cs;
819817
input_wav_data_start = ftell(fin);
820818
break;
821819
} else {

0 commit comments

Comments
 (0)