Skip to content

Commit 46300bc

Browse files
dbortfacebook-github-bot
authored andcommitted
Remove fatal ET_CHECK for unknown instruction (#1515)
Summary: Pull Request resolved: #1515 Turn an ET_CHECK into an error return when encountering an unknown instruction type. Reviewed By: larryliu0820 Differential Revision: D52451743 fbshipit-source-id: ed0b12509e234ec1f5184792f93f0cac479ad40c
1 parent 9846ba4 commit 46300bc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

runtime/executor/method.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -923,9 +923,6 @@ Method::get_outputs(EValue* output_evalues, size_t length) {
923923
}
924924

925925
Error Method::execute_instruction() {
926-
// TODO(jakeszwe): remove all the ET_CHECKS in this function and properly
927-
// return the error instead
928-
929926
auto& chain = chains_[step_state_.chain_idx];
930927
auto instructions = chain.s_chain_->instructions();
931928

@@ -1040,10 +1037,11 @@ Error Method::execute_instruction() {
10401037
internal::reset_data_ptr(t);
10411038
} break;
10421039
default:
1043-
ET_CHECK_MSG(
1044-
false,
1045-
"Instruction is not supported. %hhu",
1040+
ET_LOG(
1041+
Error,
1042+
"Unknown instruction: %hhu",
10461043
static_cast<uint8_t>(instruction->instr_args_type()));
1044+
err = Error::InvalidProgram;
10471045
}
10481046
// Reset the temp allocator for every instruction.
10491047
if (memory_manager_->temp_allocator() != nullptr) {

0 commit comments

Comments
 (0)