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
There seems to be a bug in the IR generation for when variables with the same name are assigned in assembly in neighboring scopes.
Code example to reproduce the issue:
function test_assigned_in_assembly_used_in_different_scopes(uinta, uintb) publicviewreturns(uint) {
if (a >0) {
uint v;
uint w;
assembly {
v :=mload(add(b, 0x20))
w :=byte(0, mload(add(b, 0x40)))
}
returntest_used_in_assembly_assignment(v, w);
} else {
uint v;
uint w;
assembly {
// The IRs assign to the variables `v` and `w`(defined in the then-clause)
v :=mload(add(b, 0x20))
w :=byte(0, mload(add(b, 0x40)))
}
// This call passes `v_scope0` and `w_scope1` correctly.returntest_used_in_assembly_assignment(v, w);
}
}
@0xalpharush I don't think it is addressed by that PR, since it only changes the logic if variables are initialised in tuples (statements like (v, w) = f()). But I think that the problem here may be caused by a similar issue - probably a new Expression is generated from scratch that uses old variable names.
Describe the issue:
There seems to be a bug in the IR generation for when variables with the same name are assigned in assembly in neighboring scopes.
Code example to reproduce the issue:
Version:
0.9.2
Relevant log output:
The text was updated successfully, but these errors were encountered: