Skip to content

[ICE]: Assigning to mapping in uninitialized storage struct causes error #1780

Open

Description

@Subway2023

Solang version: v0.3.3-70-g32a45ea1
Description: c.a[0] = new uint; causes a compilation error.

contract C {
    struct S { mapping(uint => uint[]) a; }
    function f(bool b) public {
        S storage c;
        assembly {
            c.slot := 0
        }
        c.a[0] = new uint[](1);
    }
}
solang_v0.3.3: llvm/lib/IR/Constants.cpp:2271: static llvm::Constant* llvm::ConstantExpr::get(unsigned int, llvm::Constant*, llvm::Constant*, unsigned int, llvm::Type*): Assertion `C1->getType() == C2->getType() && "Operand types in binary constant expression should match"' failed.
/mnt/subw3/crossCompilerFuzz/compiler/bin/solangcom: line 6: 641488 Aborted                 (core dumped) /mnt/subw3/crossCompilerFuzz/compiler/bin/solang_v0.3.3 compile --target solana "$1" -o /mnt/subw3/crossCompilerFuzz/output/temp

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions