You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using new expression to initialize a dynamic array, e.g., uint[] memory arr = new uint[](2);, slither convert it to a NewArray IR operation.
However, the type of lvalue, arr variable in the example, is incorrectly set as uint256 instead of uint256[].
Contract A
Function A.foo() (*)
Expression: arr = new uint256[](2)
IRs:
TMP_1 = new uint256[](2)
arr(uint256[]) := TMP_1(uint256) # TMP_1 has wrong type
Expression: 0
IRs:
RETURN 0
The text was updated successfully, but these errors were encountered:
0xalpharush
changed the title
[Bug-Candidate]: Incorrect variable type for NewArray operation
[Bug]: Incorrect variable type for NewArray operation
Mar 17, 2023
Describe the issue:
When using
new
expression to initialize a dynamic array, e.g.,uint[] memory arr = new uint[](2);
, slither convert it to aNewArray
IR operation.However, the type of
lvalue
,arr
variable in the example, is incorrectly set asuint256
instead ofuint256[]
.Code example to reproduce the issue:
Version:
0.9.2
Relevant log output:
The text was updated successfully, but these errors were encountered: