diff --git a/bcos-executor/src/vm/HostContext.cpp b/bcos-executor/src/vm/HostContext.cpp index fb36b861f0..9fd7e4339c 100644 --- a/bcos-executor/src/vm/HostContext.cpp +++ b/bcos-executor/src/vm/HostContext.cpp @@ -288,11 +288,18 @@ evmc_result HostContext::callBuiltInPrecompiled( { callResults->gas = _request->gas - gasUsed; } - auto [success, output] = - m_executive->executeOriginPrecompiled(_request->receiveAddress, ref(_request->data)); - resultCode = - (int32_t)(success ? TransactionStatus::None : TransactionStatus::RevertInstruction); - resultData.swap(output); + try + { + auto [success, output] = m_executive->executeOriginPrecompiled( + _request->receiveAddress, ref(_request->data)); + resultCode = + (int32_t)(success ? TransactionStatus::None : TransactionStatus::RevertInstruction); + resultData.swap(output); + } + catch (...) + { + resultCode = (int32_t)TransactionStatus::RevertInstruction; + } } else {