Skip to content

Commit 1f5e54a

Browse files
dulinrileyfacebook-github-bot
authored andcommitted
Have a DelegateCall error not abort the runtime (#360)
Summary: Pull Request resolved: #360 Right now if a DelegateCall returns an Error it causes the whole runtime to crash. This causes stuff in python unit tests to crash all of the tests at once without an exception. Change it to return the Error code instead of using `ET_CHECK` Differential Revision: D49321324 fbshipit-source-id: cac73016366417f708d940d8fc46e069a19640e1
1 parent 7b29899 commit 1f5e54a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

runtime/executor/method.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -948,11 +948,14 @@ Error Method::execute_instruction() {
948948
Error err = delegates_[delegate_idx].Execute(
949949
backend_execution_context,
950950
chain.argument_lists_[step_state_.instr_idx].data());
951-
ET_CHECK_MSG(
952-
err == Error::Ok,
953-
"CALL_DELEGATE execute failed at instruction %zu: %" PRIu32,
954-
step_state_.instr_idx,
955-
err);
951+
if (err != Error::Ok) {
952+
ET_LOG(
953+
Error,
954+
"CALL_DELEGATE execute failed at instruction %zu: %" PRIu32,
955+
step_state_.instr_idx,
956+
err);
957+
return err;
958+
}
956959
} break;
957960
case executorch_flatbuffer::InstructionArguments::JumpFalseCall: {
958961
EXECUTORCH_SCOPE_PROF("JF_CALL");

0 commit comments

Comments
 (0)