solang icon indicating copy to clipboard operation
solang copied to clipboard

Solang generates incorrect LLVM IR for multidimensional arrays

Open LucasSte opened this issue 3 years ago • 1 comments

This contract works fine for solc, but crashes on Solang (for all targets):

contract Testing {

    uint16[2][4][] stor_arr;
    function getThis() public returns (uint16) {
        uint16[2][4][] memory arr2 = stor_arr;
        return arr2[1][2][2];
    }
}

LucasSte avatar Jul 01 '22 16:07 LucasSte

This is the error I get:

solang: /home/lucas/Downloads/llvm-project/llvm/include/llvm/IR/Instructions.h:921: llvm::Type* llvm::checkGEPType(llvm::Type*): Assertion `Ty && "Invalid GetElementPtrInst indices for type!"' failed.

LucasSte avatar Jul 01 '22 16:07 LucasSte