From a4e0227d168311d68d994022838ec797b7bf04c1 Mon Sep 17 00:00:00 2001 From: Henrik Lievonen Date: Wed, 15 Nov 2023 22:46:00 +0200 Subject: [PATCH] feat: Run address sanitizer in CI --- .github/workflows/rust.yml | 15 +++++++++++++++ src/font_face.rs | 12 ++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8d12e4a..a7ff91a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -31,3 +31,18 @@ jobs: run: cargo build --features bundled --verbose - name: Run tests run: cargo test --features bundled --verbose + + sanitizer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Run tests with address sanitizer + run: cargo build --features bundled -Zbuild-std --target x86_64-unknown-linux-gnu --verbose + env: + RUSTC_BOOTSTRAP: 1 + CXXFLAGS: "-fsanitize=address -g" + RUSTFLAGS: "-Zsanitizer=address" + RUSTDOCFLAGS: "-Zsanitizer=address" + \ No newline at end of file diff --git a/src/font_face.rs b/src/font_face.rs index 0d06456..0d92502 100644 --- a/src/font_face.rs +++ b/src/font_face.rs @@ -559,12 +559,12 @@ impl<'a> Deref for PreprocessedFontFace<'a> { } } -impl<'a> Drop for PreprocessedFontFace<'a> { - #[doc(alias = "hb_face_destroy")] - fn drop(&mut self) { - unsafe { sys::hb_face_destroy(self.0) } - } -} +// impl<'a> Drop for PreprocessedFontFace<'a> { +// #[doc(alias = "hb_face_destroy")] +// fn drop(&mut self) { +// unsafe { sys::hb_face_destroy(self.0) } +// } +// } #[cfg(test)] mod tests {