Open
Description
Describe the issue:
When declaring a new array variable using another previously defined array variable, InitArray
IR operation is used, which is incorrect.
To my understanding, InitArray
only represents initializing an array literal by listing its elements.
In the example code below, Assignment
IR operation should be used instead of InitArray
.
Code example to reproduce the issue:
contract Contract {
function foo(uint[] memory arr) public {
uint[] memory arr2 = arr;
}
}
Version:
0.9.3
Relevant log output:
INFO:Printers:Contract Contract
Function Contract.foo(uint256[]) (*)
Expression: arr2 = arr
IRs:
arr2(uint256[]) = ['arr'] # InitArray operation, which is incorrect