Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler generates invalid code for library function calls by reference #153

Closed
BorisI opened this issue Apr 30, 2024 · 1 comment
Closed

Comments

@BorisI
Copy link
Collaborator

BorisI commented Apr 30, 2024

for source code:

pragma ton-solidity >= 0.74.0;

contract tce {
function fail() external pure {
bar sc;
sc.mbaz[1] = 0;
sc.foo();
}
}
struct bar {
mapping (uint16 => uint8) mbaz;
}
using libbar for bar global;
library libbar {
function foo(bar s) internal {
for ((, uint8 v): s.mbaz) {
v;
uint8 val;
if (val == 1)
return;
}
}
}

$ ever-cli -c etc/tce.conf debug run -m fail

generates trace:
...
107 3753 18 ISNULL tce.sol:16
108 3771 18 NOT tce.sol:16
109 3776 5 implicit RET
109 3776 0 RET FROM WHILE tce.sol:16
110 3794 18 IFRET build/tce.code:98
111 3844 0 UNHANDLED EXCEPTION: VM Exception: type check error, code 7, value: 0 ...src/stack/mod.rs:447 CMD: IFRET err: item is not an integer build/tce.code:98

@IgorKoval
Copy link
Collaborator

Thank you! It will be fixed in v0.75.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants