ethereum / solidity

Solidity, the Smart Contract Programming Language
https://soliditylang.org
GNU General Public License v3.0
23.13k stars 5.74k forks source link

`You shall not have another CompilerStack aside me` error in Remix when compiling with 0.5.9 #15052

Open Subway2023 opened 5 months ago

Subway2023 commented 5 months ago

Description

I used the 0.5.9 compiler in Remix to compile the program with an error, but I was able to successfully compile using binary solc

Environment

Steps to Reproduce

pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;

contract test {
    uint[2][] public originalData;
    uint[2][] public decodedData;
    function encodeData() public returns (uint) {

        originalData.push([1, 2]);
        originalData.push([3, 4]);
        originalData.push([5, 6]);

        bytes memory encodedData=abi.encode(originalData);

        decodedData = abi.decode(encodedData, (uint[2][]));

        return decodedData[1][1];
    }
}

Remix

1713969976519 1713969986986

Command

solc-0509 test.sol --bin

Successfully obtained bytecode

mehtavishwa30 commented 4 months ago

Hey @Subway2023! Thanks for reporting this.

Generally, this issue occurs if the import callback passed to solc-js has an error, but you catch it and continue using the compiler. Throwing exceptions in the callback is invalid. See https://github.com/ethereum/solc-js/issues/675#issuecomment-1402098960 for more context.

We need to check whether this is solely an issue of Remix throwing an exception in import callback or if some other bug exists on the application side i.e. Remix (in which case, I would be inclined to close this issue and suggest you open an issue in the Remix codebase).

Could you please share a brief, self-contained code snippet that we can reproduce to understand this better? We aren't able to reproduce the snippet you've provided originally.