Skip to content

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

@Subway2023

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

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