| 232 | } |
| 233 | |
| 234 | size_t AssemblyItem::returnValues() const |
| 235 | { |
| 236 | switch (m_type) |
| 237 | { |
| 238 | case Operation: |
| 239 | case EOFCreate: |
| 240 | case ReturnContract: |
| 241 | case RelativeJump: |
| 242 | case ConditionalRelativeJump: |
| 243 | case RetF: |
| 244 | // The latest EVMVersion is used here, since the InstructionInfo is assumed to be |
| 245 | // the same across all EVM versions except for the instruction name. |
| 246 | return static_cast<size_t>(instructionInfo(instruction(), EVMVersion()).ret); |
| 247 | case SwapN: |
| 248 | case DupN: |
| 249 | return static_cast<size_t>(data()) + 1; |
| 250 | case Push: |
| 251 | case PushTag: |
| 252 | case PushData: |
| 253 | case PushSub: |
| 254 | case PushSubSize: |
| 255 | case PushProgramSize: |
| 256 | case PushLibraryAddress: |
| 257 | case PushImmutable: |
| 258 | case PushDeployTimeAddress: |
| 259 | return 1; |
| 260 | case Tag: |
| 261 | return 0; |
| 262 | case VerbatimBytecode: |
| 263 | return std::get<1>(*m_verbatimBytecode); |
| 264 | case AuxDataLoadN: |
| 265 | return 1; |
| 266 | case JumpF: |
| 267 | case CallF: |
| 268 | return functionSignature().retsNum; |
| 269 | case AssignImmutable: |
| 270 | case UndefinedItem: |
| 271 | break; |
| 272 | } |
| 273 | return 0; |
| 274 | } |
| 275 | |
| 276 | bool AssemblyItem::canBeFunctional() const |
| 277 | { |
no test coverage detected