Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion runtime/executor/method.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
Expand Down Expand Up @@ -1060,6 +1060,19 @@
n_value_);
chain_instruction_arg_lists[instr_idx] = InstructionArgs();
} break;
case executorch_flatbuffer::InstructionArguments::FreeCall: {
auto index =
static_cast<const executorch_flatbuffer::FreeCall*>(
instr_args)
->value_index();
ET_CHECK_OR_RETURN_ERROR(
index >= 0 && static_cast<size_t>(index) < n_value_,
InvalidProgram,
"Index %zd negative or >= %" ET_PRIsize_t,
static_cast<ssize_t>(index),
n_value_);
chain_instruction_arg_lists[instr_idx] = InstructionArgs();
} break;
default: {
chain_instruction_arg_lists[instr_idx] = InstructionArgs();
} break;
Expand Down Expand Up @@ -1501,7 +1514,7 @@
// We know that instr_args_as_FreeCall is non-null because it was checked
// at init time.
auto free_call = instruction->instr_args_as_FreeCall();
auto t = values_[free_call->value_index()].toTensor();
auto t = mutable_value(free_call->value_index()).toTensor();
internal::reset_data_ptr(t);
} break;
default:
Expand Down
Loading