From b4a0c02d0c33a6856a0f2c59450693d3cfe988ad Mon Sep 17 00:00:00 2001 From: Giovanni Petrantoni <7008900+sinkingsugar@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:03:27 +0800 Subject: [PATCH] Add table change checks and cell initialization in Erase Ensure the Erase shard handles table modifications by checking if the table has changed and initializing the variable cell when required. --- shards/modules/core/core.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shards/modules/core/core.cpp b/shards/modules/core/core.cpp index 7015fc08ef..2355da48f0 100644 --- a/shards/modules/core/core.cpp +++ b/shards/modules/core/core.cpp @@ -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) {