From f38623ad61a7969048ee8c0afdbac0fb6ae4279d Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Tue, 13 May 2025 22:16:27 -0400 Subject: [PATCH] fix issue leading to crash --- .idea/editor.xml | 236 +++++++++++++++++++++++++++++++++ CMakeLists.txt | 2 +- examples/rice_classification.h | 2 +- include/blt/gp/operations.h | 2 +- lib/blt | 2 +- src/tree.cpp | 2 +- 6 files changed, 241 insertions(+), 5 deletions(-) diff --git a/.idea/editor.xml b/.idea/editor.xml index a8c6caa..521c365 100644 --- a/.idea/editor.xml +++ b/.idea/editor.xml @@ -1,12 +1,248 @@ + diff --git a/CMakeLists.txt b/CMakeLists.txt index 6313ebd..7c22918 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ macro(compile_options target_name) sanitizers(${target_name}) endmacro() -project(blt-gp VERSION 0.5.27) +project(blt-gp VERSION 0.5.28) include(CTest) diff --git a/examples/rice_classification.h b/examples/rice_classification.h index b779e2f..c7193df 100644 --- a/examples/rice_classification.h +++ b/examples/rice_classification.h @@ -79,7 +79,7 @@ namespace blt::gp::example BLT_DEBUG("Begin Generation Loop"); while (!program.should_terminate()) { - BLT_TRACE("------------{Begin Generation %ld}------------", program.get_current_generation()); + BLT_TRACE("------------\\{Begin Generation {}}------------", program.get_current_generation()); BLT_TRACE("Creating next generation"); program.create_next_generation(); BLT_TRACE("Move to next generation"); diff --git a/include/blt/gp/operations.h b/include/blt/gp/operations.h index 1fe2e69..ec6fb34 100644 --- a/include/blt/gp/operations.h +++ b/include/blt/gp/operations.h @@ -46,7 +46,7 @@ namespace blt::gp void print_args(std::integer_sequence) { BLT_INFO("Arguments:"); - (BLT_INFO("%ld: %s", indices, blt::type_string().c_str()), ...); + (BLT_INFO("{}: {}", indices, blt::type_string().c_str()), ...); } template diff --git a/lib/blt b/lib/blt index 9a05c86..f0fe0c1 160000 --- a/lib/blt +++ b/lib/blt @@ -1 +1 @@ -Subproject commit 9a05c86b02c9c45c2b384c531007416148ec4b56 +Subproject commit f0fe0c1ceed644513eb8fa787aac3001a906d209 diff --git a/src/tree.cpp b/src/tree.cpp index fd45888..e549db1 100644 --- a/src/tree.cpp +++ b/src/tree.cpp @@ -379,7 +379,7 @@ namespace blt::gp void tree_t::swap_subtrees(const subtree_point_t our_subtree, tree_t& other_tree, const subtree_point_t other_subtree) { swap_subtrees(child_t{our_subtree.pos, find_endpoint(our_subtree.pos)}, other_tree, - child_t{other_subtree.pos, find_endpoint(other_subtree.pos)}); + child_t{other_subtree.pos, other_tree.find_endpoint(other_subtree.pos)}); } void tree_t::replace_subtree(const subtree_point_t point, const ptrdiff_t extent, tree_t& other_tree)