mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add yield statements to compiler
This commit is contained in:
parent
87f61d960c
commit
fdaa6d54fe
@ -167,6 +167,7 @@ std::map<std::string, Instruction> 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<Instruction, InstructionInfo> 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 } },
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -147,6 +147,7 @@ struct EVMBuiltins
|
||||
static auto constexpr STATICCALL = PatternGenerator<Instruction::STATICCALL>{};
|
||||
static auto constexpr RETURN = PatternGenerator<Instruction::RETURN>{};
|
||||
static auto constexpr DELEGATECALL = PatternGenerator<Instruction::DELEGATECALL>{};
|
||||
static auto constexpr YIELD = PatternGenerator<Instruction::YIELD>{};
|
||||
static auto constexpr CREATE2 = PatternGenerator<Instruction::CREATE2>{};
|
||||
static auto constexpr REVERT = PatternGenerator<Instruction::REVERT>{};
|
||||
static auto constexpr INVALID = PatternGenerator<Instruction::INVALID>{};
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user