Open
Description
Description
When the same path is specified under urls
of multiple contracts in Standard JSON input, we get an ICE in the import callback.
Environment
- Compiler version: 0.8.27
Steps to Reproduce
input.json
:
{
"language": "Solidity",
"sources": {
"A": {"urls": ["/tmp/test.sol"]},
"B": {"urls": ["/tmp/test.sol"]}
}
}
/tmp/test.sol
// SPDX-License-Identifier: MIT
pragma solidity *;
contract C {}
solc --standard-json input.json --pretty-json --json-indent 4
Output:
{
"errors": [
{
"component": "general",
"formattedMessage": "Cannot import url (\"/tmp/test.sol\"): Exception in read callback: /solidity/libsolidity/interface/FileReader.cpp(164): Throw in function solidity::frontend::ReadCallback::Result solidity::frontend::FileReader::readFile(const std::string&, const std::string&)\nDynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>\nstd::exception::what: Solidity assertion failed\n[solidity::util::tag_comment*] = Solidity assertion failed\n",
"message": "Cannot import url (\"/tmp/test.sol\"): Exception in read callback: /solidity/libsolidity/interface/FileReader.cpp(164): Throw in function solidity::frontend::ReadCallback::Result solidity::frontend::FileReader::readFile(const std::string&, const std::string&)\nDynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>\nstd::exception::what: Solidity assertion failed\n[solidity::util::tag_comment*] = Solidity assertion failed\n",
"severity": "error",
"type": "IOError"
}
],
"sources": {
"A": {
"id": 0
}
}
}
Metadata
Metadata
Assignees
Labels
There is not much implementation work to be done. The task is very easy or tiny.Changes are not very noticeable or potential benefits are limited.Something we consider essential but not enough to prevent us from releasing Solidity 1.0 without it.Error is reported even though it shouldn't. Source is fine.