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

Multiple layers of map cause an execution error. #1741

Open
Subway2023 opened this issue Feb 11, 2025 · 0 comments
Open

Multiple layers of map cause an execution error. #1741

Subway2023 opened this issue Feb 11, 2025 · 0 comments

Comments

@Subway2023
Copy link

Version: v0.3.3: Atlantis
Description: The statement _map[1] = 2; will cause an execution error.

contract test {
    mapping(uint name1 => mapping(uint name2 => uint name3) name4) map;

    function main() external {
        mapping(uint name5 => uint name6) storage _map = map[1];
        _map[1] = 2;
    }
}

Reproduction: I set up a Solang compilation and execution environment to test the program.

solang/target/debug/vmRunNoPara test.sol test main

The execution error is as follows:

Contract name: test
function new for CoLc3bRbZgD312naQRUcK8jtyTvE1Bti3n1iedTszS58
input: 872ccdc6190148bc
running bpf with calldata:872ccdc6190148bc
program: CoLc3bRbZgD312naQRUcK8jtyTvE1Bti3n1iedTszS58
static: length:3f0 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
offset:410 prev:10 next:10 length:0 allocated:0 
function main for CoLc3bRbZgD312naQRUcK8jtyTvE1Bti3n1iedTszS58
input: 7c0377ca664c5a9d
running bpf with calldata:7c0377ca664c5a9d
program: CoLc3bRbZgD312naQRUcK8jtyTvE1Bti3n1iedTszS58
sol_set_return_data: 
static: length:3f0 000000001004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
offset:410 prev:10 next:448 length:40 allocated:1 01000000000000000000000000000000000000000000000000000000000000000000000000000000
offset:448 prev:410 next:458 length:72 allocated:1 010000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000
thread 'main' panicked at src/tests/solana.rs:1717:17:
assertion failed: length <= space
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
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

1 participant