solang icon indicating copy to clipboard operation
solang copied to clipboard

[ICE]: Assigning a value to the struct variable's slot causes an error.

Open Subway2023 opened this issue 9 months ago • 0 comments

Solang version: v0.3.3-70-g32a45ea1 Description: c.slot := add(c.slot, 1) causes a compilation error.

contract C {
    struct S { bool f; }
    S s;
    function f() internal pure returns (S storage c) {
        assembly {
            for { c.slot := s.slot } iszero(eq(c.slot, 0)) { c.slot := add(c.slot, 1) } {}
        }
    }
}
solang_v0.3.3-70-g32a45ea1: /home/runner/work/solang-llvm/solang-llvm/llvm-project/llvm/include/llvm/IR/Instructions.h:2799: void llvm::PHINode::setIncomingValue(unsigned int, llvm::Value*): Assertion `getType() == V->getType() && "All operands to PHI node must be the same type as the PHI node!"' failed.
Aborted

Subway2023 avatar Mar 23 '25 08:03 Subway2023