-
-
Notifications
You must be signed in to change notification settings - Fork 16
Fix sanitizers not applying to library code #2596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,13 @@ if(PROJECT_IS_TOP_LEVEL) | |
| sourcemeta_enable_simd() | ||
| endif() | ||
|
|
||
| # Enable the sanitizers before defining any target | ||
| if(SOURCEMETA_CORE_ADDRESS_SANITIZER) | ||
| sourcemeta_sanitizer(TYPE address) | ||
| elseif(SOURCEMETA_CORE_UNDEFINED_SANITIZER) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Because this uses Prompt for AI agents |
||
| sourcemeta_sanitizer(TYPE undefined) | ||
| endif() | ||
|
|
||
| # TODO: Turn this into a re-usable utility CMake function | ||
| if(SOURCEMETA_CORE_INSTALL) | ||
| include(GNUInstallDirs) | ||
|
|
@@ -226,12 +233,6 @@ if(SOURCEMETA_CORE_MARKDOWN) | |
| add_subdirectory(src/core/markdown) | ||
| endif() | ||
|
|
||
| if(SOURCEMETA_CORE_ADDRESS_SANITIZER) | ||
| sourcemeta_sanitizer(TYPE address) | ||
| elseif(SOURCEMETA_CORE_UNDEFINED_SANITIZER) | ||
| sourcemeta_sanitizer(TYPE undefined) | ||
| endif() | ||
|
|
||
| if(SOURCEMETA_CORE_DOCS) | ||
| sourcemeta_target_doxygen(CONFIG "${PROJECT_SOURCE_DIR}/doxygen/Doxyfile.in" | ||
| OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/website") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMakeLists.txt(diff line 62): because this is anif/elseif, if bothSOURCEMETA_CORE_ADDRESS_SANITIZERandSOURCEMETA_CORE_UNDEFINED_SANITIZERare enabled, only the address sanitizer will be applied and the undefined sanitizer will be silently ignored.Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.