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

[BUG] Assertion failed. solidity/libsolidity/analysis/TypeChecker.cpp(2371) #15733

Open
Jizhou-Chen opened this issue Jan 20, 2025 · 0 comments
Labels

Comments

@Jizhou-Chen
Copy link

Description

Error:

Internal compiler error:
/solidity/libsolidity/analysis/TypeChecker.cpp(2371): Throw in function void solidity::frontend::TypeChecker::typeCheckBytesConcatFunction(const solidity::frontend::FunctionCall&, const solidity::frontend::FunctionType*)
Dynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>
std::exception::what: Solidity assertion failed
[solidity::util::tag_comment*] = Solidity assertion failed

Environment

  • Compiler version: Version: 0.8.28-develop.2025.1.19+commit.7893614a.mod.Linux.g++
  • Compilation pipeline (legacy, IR, EOF):
  • Target EVM version (as per compiler settings):
  • Framework/IDE (e.g. Foundry, Hardhat, Remix):
  • EVM execution environment / backend / blockchain client:
  • Operating system: Ubuntu 22.04

Steps to Reproduce

poc.sol (fuzzer-generated):

contract C {
    bytes public x = "abc";
    bytes public y;
    function invalidateXShort() public {
        assembly { sstore(x.slot, 64) }
        delete y;
    }
    function invalidateXLong() public {
        assembly { sstore(x.slot, 5) }
        delete y;
    }
    function abiEncode() public view returns (bytes memory) { return x; }
    function foo() internal { msg.sender; }
    function j() public {
        assembly { pop(call(0, 1, 2, 3, 4, 5, 6)) }
    }
    function indexAccess() public view returns (bytes1) { uint x; }
    function assignTo() public { x = "def"; }
    function assignToLong() public { x = "1234567890123456789012345678901234567"; }
    function copyToStorage() public { y = x; }
    function copyFromStorageShort() public { y = "abc"; x = y; }
    function copyFromStorageLong() public { y = "1234567890123456789012345678901234567"; x = y; }
    function arrayPop() public { 2; }
    function arrayPush() public { bytes.concat({x: 1, y: "abc", z: true}); }
    function arrayPushEmpty() public { 2; }
    function del() public { delete x; }
}

To reproduce:
solc --bin -o poc poc.sol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant