Fix DUP_X2 and DUP_X1 not copying values correctly
The DUP_X2
(and therefore DUP_X1
) are changing the whole stack structure. For example the stack would change like this: value3, value2, value1 -> value1, value3, value2, value1
. As you can see whole stack changed. None of the values are on their right places, so we need to call Interpreter#copyOperation
on all values.
Unlike the DUP
where the stack changes like: value -> value, value
. You can see that only the first value is in the right place and it doesn't need to call Interpreter#copyOperation
. Only the second value needs a call to Interpreter#copyOperation
.
Also added a test for it.