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
The IR for pop obtains a reference variable to the final array element and deletes it. The type of this reference variable is always uint256, but it should be equal to the type of the array's elements.
Code example to reproduce the issue:
contract Poptest {
struct S {
int x;
int y;
}
S[] a;
function poptest() internal {
a.pop();
}
}
Version:
0.9.3
Relevant log output:
INFO:Printers:Contract Poptest
Function Poptest.poptest() (*)
Expression: a.pop()
IRs:
REF_1 -> LENGTH a
TMP_1(uint256) = REF_1 (c)- 1
REF_2(uint256) -> a[TMP_1]
a = delete REF_2
REF_3 -> LENGTH a
REF_3 (->a) := TMP_1(uint256)
The text was updated successfully, but these errors were encountered:
I noticed that a fix for this was recently developed, but I don't think it handles popping from bytes correctly. I think the type of an element of bytes is bytes1, but the type that the fix gives the reference variable is bytes.
Describe the issue:
The IR for pop obtains a reference variable to the final array element and deletes it. The type of this reference variable is always uint256, but it should be equal to the type of the array's elements.
Code example to reproduce the issue:
Version:
0.9.3
Relevant log output:
The text was updated successfully, but these errors were encountered: