1

After compiling this contract:

pragma solidity ^0.4.25;

contract Simplest {
    constructor() public {
    }

    function two_paths(bool _a) public pure returns (uint) {
        if (_a == true) {
            return 1;
        } else {
            return 0;
        }
    }
}

The following opcode output is observed in Remix:

...
tag 6           function two_paths(bool _a) pu...
      JUMPDEST          function two_paths(bool _a) pu...
      SWAP2             function two_paths(bool _a) pu...
      SWAP1             function two_paths(bool _a) pu...
      POP           function two_paths(bool _a) pu...
      JUMP [out]            function two_paths(bool _a) pu...
    .data

In particular, notice the JUMP operation with [OUT] attached to it. Normally Remix JUMP operations don't have attached data to them.

Can you help understand what that JUMP instruction stands for and perhaps is it a dynamic jump (as I don't see a PUSH statement ahead of it).

1

There are not so many alternatives. In EVM, JUMP can jump uniquely to a location where an opcode JUMPDEST is found. So [OUT] should be referred to the address of a JUMPDEST opcode.

I have not your bytecode here, but you can inspect it searching for opcode JUMPDEST and one of them should be tagged OUT.

(anyway as soon as I can I will reproduce this... and if something interesting comes out, I’ll be back here)

EDIT:

This is, apparently, what I get after deploying on VM Javascript and debugging the code. Your code fragment is around line 190, where no [out] tag appears. Are you not possibly using deployed bytecode?

000 PUSH1 80
002 PUSH1 40
004 MSTORE
005 CALLVALUE
006 DUP1
007 ISZERO
008 PUSH2 0010
011 JUMPI
012 PUSH1 00
014 DUP1
015 REVERT
016 JUMPDEST
017 POP
018 PUSH1 d0
020 DUP1
021 PUSH2 001f
024 PUSH1 00
026 CODECOPY
027 PUSH1 00
029 RETURN
030 STOP
031 PUSH1 80
033 PUSH1 40
035 MSTORE
036 PUSH1 04
038 CALLDATASIZE
039 LT
040 PUSH1 3f
042 JUMPI
043 PUSH1 00
045 CALLDATALOAD
046 PUSH29 0100000000000000000000000000000000000000000000000000000000
076 SWAP1
077 DIV
078 PUSH4 ffffffff
083 AND
084 DUP1
085 PUSH4 4d6406e0
090 EQ
091 PUSH1 44
093 JUMPI
094 JUMPDEST
095 PUSH1 00
097 DUP1
098 REVERT
099 JUMPDEST
100 CALLVALUE
101 DUP1
102 ISZERO
103 PUSH1 4f
105 JUMPI
106 PUSH1 00
108 DUP1
109 REVERT
110 JUMPDEST
111 POP
112 PUSH1 6e
114 PUSH1 04
116 DUP1
117 CALLDATASIZE
118 SUB
119 DUP2
120 ADD
121 SWAP1
122 DUP1
123 DUP1
124 CALLDATALOAD
125 ISZERO
126 ISZERO
127 SWAP1
128 PUSH1 20
130 ADD
131 SWAP1
132 SWAP3
133 SWAP2
134 SWAP1
135 POP
136 POP
137 POP
138 PUSH1 84
140 JUMP
141 JUMPDEST
142 PUSH1 40
144 MLOAD
145 DUP1
146 DUP3
147 DUP2
148 MSTORE
149 PUSH1 20
151 ADD
152 SWAP2
153 POP
154 POP
155 PUSH1 40
157 MLOAD
158 DUP1
159 SWAP2
160 SUB
161 SWAP1
162 RETURN
163 JUMPDEST
164 PUSH1 00
166 PUSH1 01
168 ISZERO
169 ISZERO
170 DUP3
171 ISZERO
172 ISZERO
173 EQ
174 ISZERO
175 PUSH1 9a
177 JUMPI
178 PUSH1 01
180 SWAP1
181 POP
182 PUSH1 9f
184 JUMP
185 JUMPDEST
186 PUSH1 00
188 SWAP1
189 POP
190 JUMPDEST
191 SWAP2
192 SWAP1
193 POP
194 JUMP
195 STOP
196 LOG1
197 PUSH6 627a7a723058
204 SHA3
205 PUSH13 9be64cee27040585cd05b25f02
219 MUL
220 GT
221 INVALID
222 INVALID
223 MSTORE8
224 LOG3
225 SGT
226 EQ
227 PUSH27 b9efc6cc265d1e8dd70029
  • There are no tags called [in] or [out]. Remix uses the syntax tag # for that. – Peteris Feb 23 at 8:27
  • I’ll try to forward your question to Yann, the remix developer. – Rick Park Feb 23 at 10:36
  • Thanks a lot! I tried to ask on Gitter but didn’t get a response yet. – Peteris Feb 23 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.