Skip to content

Commit

Permalink
20788: Fixes crashes when performing updates to SBFDS when values are…
Browse files Browse the repository at this point in the history
… interned (#167)
  • Loading branch information
howsohazard authored Jul 6, 2024
1 parent 2dcdd36 commit 939af79
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Amalgam/SeparableBoxFilterDataStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,13 @@ void SeparableBoxFilterDataStore::RemoveEntity(Entity *entity, size_t entity_ind
{
auto &column_data = columnData[column_index];

auto &val_to_overwrite = GetValue(entity_index, column_index);
auto type_to_overwrite = column_data->GetIndexValueType(entity_index);
auto &val_to_overwrite_raw = GetValue(entity_index, column_index);
auto type_to_overwrite_raw = column_data->GetIndexValueType(entity_index);
auto val_to_overwrite = column_data->GetResolvedValue(type_to_overwrite_raw, val_to_overwrite_raw);
auto type_to_overwrite = column_data->GetResolvedValueType(type_to_overwrite_raw);

auto &raw_value_to_reassign = GetValue(entity_index_to_reassign, column_index);
auto raw_value_type_to_reassign = column_data->GetIndexValueType(entity_index_to_reassign);
//need to resolve the value just in case things move around due to entity_index being deleted
auto value_to_reassign = column_data->GetResolvedValue(raw_value_type_to_reassign, raw_value_to_reassign);
auto value_type_to_reassign = column_data->GetResolvedValueType(raw_value_type_to_reassign);

Expand Down Expand Up @@ -267,8 +268,8 @@ void SeparableBoxFilterDataStore::UpdateEntityLabel(Entity *entity, size_t entit
//remove the label if no longer relevant
if(IsColumnIndexRemovable(column_index))
RemoveColumnIndex(column_index);

OptimizeColumn(column_index);
else
OptimizeColumn(column_index);
}

//populates distances_out with all entities and their distances that have a distance to target less than max_dist
Expand Down

0 comments on commit 939af79

Please sign in to comment.