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

[ICE]: Using a map with tuple assignment causes an error. #1762

Open
Subway2023 opened this issue Mar 12, 2025 · 0 comments
Open

[ICE]: Using a map with tuple assignment causes an error. #1762

Subway2023 opened this issue Mar 12, 2025 · 0 comments

Comments

@Subway2023
Copy link

Version: v0.3.3: v0.3.3-70-g32a45ea1
Description: Solc can compile normally. The error location in the source code can be found at the link.

contract c {
    struct S {
        uint256 a;
        uint256 b;
    }
    mapping(uint256 => S) public x;
    mapping(uint256 => S) public y;

    function swap() public {
        (x[0], y[0]) = (y[0], x[0]);
    }
}
thread 'main' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/inkwell-0.4.0/src/values/enums.rs:302:13:
Found IntValue(IntValue { int_value: Value { name: "offset1", address: 0x57390d2a2750, is_const: false, is_null: false, is_undef: false, llvm_value: "  %offset1 = load i32, ptr %offset, align 4", llvm_type: "i32" } }) but expected PointerValue variant
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7608018cbdac9e55d0d13529cf43adc33d53efcf/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/7608018cbdac9e55d0d13529cf43adc33d53efcf/library/core/src/panicking.rs:74:14
   2: inkwell::values::enums::BasicValueEnum::into_pointer_value
             at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/inkwell-0.4.0/src/values/enums.rs:302:13
   3: solang::emit::solana::target::<impl solang::emit::TargetRuntime for solang::emit::solana::SolanaTarget>::storage_store
             at ./src/emit/solana/target.rs:1266:29
   4: solang::emit::instructions::process_instruction
             at ./src/emit/instructions.rs:141:13
   5: solang::emit::cfg::emit_cfg
             at ./src/emit/cfg.rs:211:13
   6: solang::emit::functions::emit_functions
             at ./src/emit/functions.rs:49:9
   7: solang::emit::solana::SolanaTarget::build
             at ./src/emit/solana/mod.rs:73:9
   8: solang::emit::binary::Binary::build
             at ./src/emit/binary.rs:185:31
   9: solang::emit::<impl solang::sema::ast::Contract>::binary
             at ./src/emit/mod.rs:376:9
  10: solang::contract_results
             at ./src/bin/solang.rs:414:18
  11: solang::compile
             at ./src/bin/solang.rs:272:17
  12: solang::main
             at ./src/bin/solang.rs:59:13
  13: core::ops::function::FnOnce::call_once
             at /root/.rustup/toolchains/nightly-2024-09-30-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
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