Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ if(JSONBINPACK_INSTALL)
COMPONENT sourcemeta_jsonbinpack_dev)
endif()

if(JSONBINPACK_ADDRESS_SANITIZER)
sourcemeta_sanitizer(TYPE address)
elseif(JSONBINPACK_UNDEFINED_SANITIZER)
sourcemeta_sanitizer(TYPE undefined)
endif()

# Runtime
if(JSONBINPACK_RUNTIME)
add_subdirectory(src/runtime)
Expand All @@ -46,12 +52,6 @@ if(JSONBINPACK_COMPILER)
add_subdirectory(src/compiler)
endif()

if(JSONBINPACK_ADDRESS_SANITIZER)
sourcemeta_sanitizer(TYPE address)
elseif(JSONBINPACK_UNDEFINED_SANITIZER)
sourcemeta_sanitizer(TYPE undefined)
endif()

if(JSONBINPACK_DOCS)
sourcemeta_target_doxygen(CONFIG "${PROJECT_SOURCE_DIR}/doxygen/Doxyfile.in"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/www")
Expand Down
4 changes: 2 additions & 2 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
vendorpull https://github.com/sourcemeta/vendorpull 1dcbac42809cf87cb5b045106b863e17ad84ba02
core https://github.com/sourcemeta/core 036ae97b31bf133fa5c19ad0192bc1eb008f1b0b
blaze https://github.com/sourcemeta/blaze 31d3723e2bfac22acbaaae23f1f9d02e75ce4c00
core https://github.com/sourcemeta/core 3e1d11893f8a7144c4ec2267f5d3f54da551f083
blaze https://github.com/sourcemeta/blaze 554ac837d7a088602276df5fff6fac21434fbeda
bootstrap https://github.com/twbs/bootstrap 1a6fdfae6be09b09eaced8f0e442ca6f7680a61e
6 changes: 6 additions & 0 deletions cmake/FindCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ if(NOT Core_FOUND)
set(SOURCEMETA_CORE_INSTALL OFF CACHE BOOL "disable installation")
endif()

if(JSONBINPACK_ADDRESS_SANITIZER OR JSONBINPACK_UNDEFINED_SANITIZER)
set(SOURCEMETA_CORE_USE_SYSTEM_ALLOCATOR ON CACHE BOOL "enable the system allocator")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When a build dir is first configured without a sanitizer and then re-configured with JSONBINPACK_ADDRESS_SANITIZER=ON, set(... CACHE BOOL ...) without FORCE is a no-op because SOURCEMETA_CORE_USE_SYSTEM_ALLOCATOR is already cached as OFF, so core still links mimalloc (vendor/core/CMakeLists.txt only skips it when this flag AND the sanitizer flags are false). This is a derived value that must track the sanitizer input, so use FORCE so toggling the sanitizer in the same build dir reliably switches core to the system allocator.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cmake/FindCore.cmake, line 9:

<comment>When a build dir is first configured without a sanitizer and then re-configured with JSONBINPACK_ADDRESS_SANITIZER=ON, `set(... CACHE BOOL ...)` without FORCE is a no-op because SOURCEMETA_CORE_USE_SYSTEM_ALLOCATOR is already cached as OFF, so core still links mimalloc (vendor/core/CMakeLists.txt only skips it when this flag AND the sanitizer flags are false). This is a derived value that must track the sanitizer input, so use FORCE so toggling the sanitizer in the same build dir reliably switches core to the system allocator.</comment>

<file context>
@@ -5,6 +5,12 @@ if(NOT Core_FOUND)
   endif()
 
+  if(JSONBINPACK_ADDRESS_SANITIZER OR JSONBINPACK_UNDEFINED_SANITIZER)
+    set(SOURCEMETA_CORE_USE_SYSTEM_ALLOCATOR ON CACHE BOOL "enable the system allocator")
+  else()
+    set(SOURCEMETA_CORE_USE_SYSTEM_ALLOCATOR OFF CACHE BOOL "disable the system allocator")
</file context>

else()
set(SOURCEMETA_CORE_USE_SYSTEM_ALLOCATOR OFF CACHE BOOL "disable the system allocator")
endif()

set(SOURCEMETA_CORE_LANG_PROCESS OFF CACHE BOOL "disable")
set(SOURCEMETA_CORE_LANG_PARALLEL OFF CACHE BOOL "disable")
set(SOURCEMETA_CORE_LANG_ERROR OFF CACHE BOOL "disable")
Expand Down
13 changes: 7 additions & 6 deletions vendor/blaze/CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/blaze/DEPENDENCIES

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 32 additions & 7 deletions vendor/blaze/src/bundle/bundle.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 23 additions & 24 deletions vendor/blaze/src/foundation/foundation.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 28 additions & 4 deletions vendor/blaze/src/test/include/sourcemeta/blaze/test.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 56 additions & 28 deletions vendor/blaze/src/test/test_parser.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/blaze/src/test/test_runner.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading