diff --git a/libevmasm/Instruction.cpp b/libevmasm/Instruction.cpp index 418a6e185..7a256942e 100644 --- a/libevmasm/Instruction.cpp +++ b/libevmasm/Instruction.cpp @@ -167,6 +167,7 @@ std::map const solidity::evmasm::c_instructions = { "CALL", Instruction::CALL }, { "CALLCODE", Instruction::CALLCODE }, { "STATICCALL", Instruction::STATICCALL }, + { "YIELD", Instruction::YIELD }, { "RETURN", Instruction::RETURN }, { "DELEGATECALL", Instruction::DELEGATECALL }, { "CREATE2", Instruction::CREATE2 }, @@ -317,6 +318,7 @@ static std::map const c_instructionInfo = { Instruction::RETURN, { "RETURN", 0, 2, 0, true, Tier::Zero } }, { Instruction::DELEGATECALL, { "DELEGATECALL", 0, 6, 1, true, Tier::Special } }, { Instruction::STATICCALL, { "STATICCALL", 0, 6, 1, true, Tier::Special } }, + { Instruction::YIELD, { "YIELD", 0, 0, 0, true, Tier::VeryLow } }, // TODO: Gas & SideEffects { Instruction::CREATE2, { "CREATE2", 0, 4, 1, true, Tier::Special } }, { Instruction::REVERT, { "REVERT", 0, 2, 0, true, Tier::Zero } }, { Instruction::INVALID, { "INVALID", 0, 0, 0, true, Tier::Zero } }, diff --git a/libevmasm/Instruction.h b/libevmasm/Instruction.h index 48ee37b5c..a2b491885 100644 --- a/libevmasm/Instruction.h +++ b/libevmasm/Instruction.h @@ -184,6 +184,7 @@ enum class Instruction: uint8_t CREATE2 = 0xf5, ///< create new account with associated code at address `sha3(0xff + sender + salt + init code) % 2**160` STATICCALL = 0xfa, ///< like CALL but disallow state modifications + YIELD = 0xfc, REVERT = 0xfd, ///< halt execution, revert state and return output data INVALID = 0xfe, ///< invalid instruction for expressing runtime errors (e.g., division-by-zero) SELFDESTRUCT = 0xff ///< halt execution and register account for later deletion diff --git a/libevmasm/SemanticInformation.cpp b/libevmasm/SemanticInformation.cpp index b6bcc8280..03abe9e4e 100644 --- a/libevmasm/SemanticInformation.cpp +++ b/libevmasm/SemanticInformation.cpp @@ -248,6 +248,7 @@ bool SemanticInformation::altersControlFlow(AssemblyItem const& _item) case Instruction::RETURN: case Instruction::SELFDESTRUCT: case Instruction::STOP: + case Instruction::YIELD: case Instruction::INVALID: case Instruction::REVERT: return true; diff --git a/libevmasm/SimplificationRule.h b/libevmasm/SimplificationRule.h index e970068fb..df76ef08b 100644 --- a/libevmasm/SimplificationRule.h +++ b/libevmasm/SimplificationRule.h @@ -147,6 +147,7 @@ struct EVMBuiltins static auto constexpr STATICCALL = PatternGenerator{}; static auto constexpr RETURN = PatternGenerator{}; static auto constexpr DELEGATECALL = PatternGenerator{}; + static auto constexpr YIELD = PatternGenerator{}; static auto constexpr CREATE2 = PatternGenerator{}; static auto constexpr REVERT = PatternGenerator{}; static auto constexpr INVALID = PatternGenerator{}; diff --git a/scripts/build.sh b/scripts/build.sh index 6edd60bd9..330ce2c8c 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -17,7 +17,7 @@ fi mkdir -p "${BUILDDIR}" cd "${BUILDDIR}" -cmake .. -DCMAKE_BUILD_TYPE="$BUILD_TYPE" "${@:2}" +cmake .. -DUSE_Z3=OFF -DCMAKE_BUILD_TYPE="$BUILD_TYPE" "${@:2}" make -j2 if [[ "${CI}" == "" ]]; then diff --git a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp index db0e64828..e7f126f63 100644 --- a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp +++ b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp @@ -374,6 +374,7 @@ u256 EVMInstructionInterpreter::eval( case Instruction::POP: break; // --------------- invalid in strict assembly --------------- + case Instruction::YIELD: case Instruction::JUMP: case Instruction::JUMPI: case Instruction::JUMPDEST: