Skip to content

Commit 4b1da2c

Browse files
Comments
1 parent b17ab3d commit 4b1da2c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/internal.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,10 +853,6 @@ struct State {
853853
/// A flat list of variable data structures, including unused one
854854
std::vector<Variable> variables;
855855

856-
#ifndef NDEBUG
857-
PointerMap ptr_to_variable;
858-
#endif
859-
860856
/// A priority queue of indices into 'variables' that are currently unused
861857
UnusedPQ unused_variables;
862858

@@ -933,6 +929,13 @@ struct State {
933929
uint32_t optix_default_sbt_index = 0;
934930
#endif
935931

932+
#ifndef NDEBUG
933+
/// Mapping from pointers that are managed by variables to their variable
934+
/// indices. This is used for debugging purposes in frozen functions.
935+
PointerMap ptr_to_variable;
936+
#endif
937+
938+
936939
State() {
937940
variables.resize(1);
938941
extra.resize(1);

src/var.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ JIT_NOINLINE void jitc_var_free(uint32_t index, Variable *v) noexcept {
313313
jitc_free(v->data);
314314

315315
#ifndef NDEBUG
316+
// This warning should never be thrown, except if we forgot to
317+
// populate the mapping
316318
if (!state.ptr_to_variable.contains(v->data))
317319
jitc_log(
318320
LogLevel::Warn,

0 commit comments

Comments
 (0)