27 #if EVM_JUMPS_AND_SUBS 40 for (PC = 0; (OP = m_code[PC]); ++PC)
41 if (OP ==
byte(Instruction::BEGINSUB))
42 validateSubroutine(PC, m_return, m_stack);
43 else if (OP ==
byte(Instruction::BEGINDATA))
46 (
byte)Instruction::PUSH1 <= (
byte)OP &&
47 (
byte)PC <= (
byte)Instruction::PUSH32)
48 PC += (
byte)OP - (
byte)Instruction::PUSH1;
50 OP == Instruction::JUMPTO ||
51 OP == Instruction::JUMPIF ||
52 OP == Instruction::JUMPSUB)
54 else if (OP == Instruction::JUMPV || op == Instruction::JUMPSUBV)
63 void VM::validateSubroutine(uint64_t _PC, uint64_t* _RP,
u256* _SP)
66 m_PC = _PC, m_RP = _RP, m_SP = _SP;
74 ptrdiff_t frameSize = m_frameSize[m_PC];
78 if (stackSize() != frameSize)
79 throwBadStack(stackSize(), frameSize, 0);
85 m_frameSize[m_PC] = stackSize();
93 m_PC = decodeJumpDest(m_code, m_PC);
101 _PC = m_PC, _RP = m_RP, _SP = m_SP;
102 validateSubroutine(decodeJumpvDest(m_code, m_PC, m_SP), _RP, _SP);
103 m_PC = _PC, m_RP = _RP, m_SP = _SP;
111 for (
size_t dest = 0, nDests = m_code[m_PC+1]; dest < nDests; ++dest)
115 _PC = m_PC, _RP = m_RP, _SP = m_SP;
116 validateSubroutine(decodeJumpDest(m_code, m_PC), _RP, _SP);
117 m_PC = _PC, m_RP = _RP, m_SP = _SP;
125 size_t destPC = decodeJumpDest(m_code, m_PC);
126 byte nArgs = m_code[destPC+1];
127 if (stackSize() < nArgs)
128 throwBadStack(stackSize(), nArgs, 0);
136 for (
size_t sub = 0, nSubs = m_code[m_PC+1]; sub < nSubs; ++sub)
141 size_t destPC = decodeJumpvDest(m_code, _PC, _SP);
142 byte nArgs = m_code[destPC+1];
143 if (stackSize() < nArgs)
144 throwBadStack(stackSize(), nArgs, 0);
164 throwBadInstruction();
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
halt execution returning output data
std::hash for asio::adress
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
Interface and null implementation of the class for specifying VM externalities.