-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Open
Labels
Description
In the legacy codegen, the log arguments are evaluated from right to left, whereas in the IR-based codegen, they are evaluated from left to right. However, this difference is not reflected in the documentation.
contract EventEvalOrder {
uint public a;
event Log(uint indexed first, uint indexed second, uint indexed third);
function call1() public returns (uint) {
a = 1;
return 10;
}
function call2() public returns (uint) {
a = 2;
return 20;
}
function call3() public returns (uint) {
a = 3;
return 30;
}
function triggerEvent() public returns (uint) {
emit Log(call1(), call2(), call3());
return a;
}
}
legacy codegen: a=1
ir-based codegen: a=3