Skip to content

Commit

Permalink
Merge pull request acts-project#819 from niermann999/fix-navigation-a…
Browse files Browse the repository at this point in the history
…sserts

fix: navigation assertion
  • Loading branch information
stephenswat authored Sep 19, 2024
2 parents 1d6b433 + 0814c6e commit 9e25aab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Set up the project.
cmake_minimum_required( VERSION 3.11 )
project( detray VERSION 0.75.1 LANGUAGES CXX )
project( detray VERSION 0.75.2 LANGUAGES CXX )

# Set up the used C++ standard(s).
set( CMAKE_CXX_STANDARD 20 CACHE STRING "The (host) C++ standard to use" )
Expand Down
9 changes: 6 additions & 3 deletions core/include/detray/navigation/navigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ class navigator {
/// Set start/new volume
DETRAY_HOST_DEVICE
inline void set_volume(dindex v) {
assert(v < detector().volumes().size());
assert(detail::is_invalid_value(static_cast<nav_link_type>(v)) ||
v < detector().volumes().size());
if (v != m_volume_index) {
// Make sure the new volume is properly initialized
set_no_trust();
Expand Down Expand Up @@ -694,8 +695,10 @@ class navigator {
return navigation.m_heartbeat;
}

assert(navigation.volume() <
navigation.detector().volumes().size());
// Either end of world or valid volume index
assert(detail::is_invalid_value(navigation.volume()) ||
navigation.volume() <
navigation.detector().volumes().size());

// Run inspection when needed (keep for debugging)
// const auto &track = propagation._stepping();
Expand Down

0 comments on commit 9e25aab

Please sign in to comment.