Skip to content

Commit

Permalink
Add table change checks and cell initialization in Erase
Browse files Browse the repository at this point in the history
Ensure the Erase shard handles table modifications by checking if the table has changed and initializing the variable cell when required.
  • Loading branch information
sinkingsugar committed Nov 19, 2024
1 parent 199eb58 commit b4a0c02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions shards/modules/core/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,13 @@ struct Erase : SeqUser {
}

SHVar activate(SHContext *context, const SHVar &input) {
if (unlikely(_isTable)) {
checkIfTableChanged();
if (unlikely(_cell == nullptr)) {
fillVariableCell();
}
}

const auto &indices = _indices.get();
if (_cell->valueType == SHType::Table) {
if (indices.valueType != SHType::Seq) {
Expand Down

0 comments on commit b4a0c02

Please sign in to comment.