@@ -111,6 +111,7 @@ const RuntimeFunctions &getRuntimeFunctionTable() {
111111 .HandleStaticCall = &evmHandleStaticCall,
112112 .SetRevert = &evmSetRevert,
113113 .HandleInvalid = &evmHandleInvalid,
114+ .HandleUndefined = &evmHandleUndefined,
114115 .HandleSelfDestruct = &evmHandleSelfDestruct,
115116 .GetKeccak256 = &evmGetKeccak256};
116117 return Table;
@@ -997,14 +998,23 @@ uint64_t evmHandleCallCode(zen::runtime::EVMInstance *Instance, uint64_t Gas,
997998}
998999
9991000void evmHandleInvalid (zen::runtime::EVMInstance *Instance) {
1000- // Immediately terminate the execution and return the revert code (2 )
1001+ // Immediately terminate the execution and return the invalid code (4 )
10011002 evmc::Result ExeResult (
10021003 EVMC_INVALID_INSTRUCTION, 0 , Instance ? Instance->getGasRefund () : 0 ,
10031004 Instance->getReturnData ().data (), Instance->getReturnData ().size ());
10041005 Instance->setExeResult (std::move (ExeResult));
10051006 Instance->exit (4 );
10061007}
10071008
1009+ void evmHandleUndefined (zen::runtime::EVMInstance *Instance) {
1010+ // Immediately terminate the execution and return the undefined code
1011+ evmc::Result ExeResult (
1012+ EVMC_UNDEFINED_INSTRUCTION, 0 , Instance ? Instance->getGasRefund () : 0 ,
1013+ Instance->getReturnData ().data (), Instance->getReturnData ().size ());
1014+ Instance->setExeResult (std::move (ExeResult));
1015+ Instance->exit (5 );
1016+ }
1017+
10081018uint64_t evmHandleDelegateCall (zen::runtime::EVMInstance *Instance,
10091019 uint64_t Gas, const uint8_t *ToAddr,
10101020 uint64_t ArgsOffset, uint64_t ArgsSize,
0 commit comments