🐛 Bug
Code block like this
fun calculate(x: u256, y:u256, z:u256): u256 {
let y_prev = y;
if (z > 1000) {
y = y + 1;
} else {
y = y - 1;
};
if (y > y_prev) {
return x
} else {
return y
}
}
Decompile code
fun calculate(arg0: u256, arg1: u256, arg2: u256) : u256 {
if (arg2 > 1000) {
arg1 = arg1 + 1;
} else {
arg1 = arg1 - 1;
};
if (arg1 > arg1) {
return arg0
};
arg1
}
To reproduce
- publish the code to testnet with
included-artifacts=none
- download bytecode from testnet
- decompile source from bytecode
Expected Behavior
y should compare with its old value y_prev not itself