mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11503 from ethereum/issue-11501
Fix crash in ControlFlowGraph related to free functions.
This commit is contained in:
commit
edee67b4cc
@ -141,11 +141,9 @@ public:
|
|||||||
// containers using this struct
|
// containers using this struct
|
||||||
bool operator<(FunctionContractTuple const& _other) const
|
bool operator<(FunctionContractTuple const& _other) const
|
||||||
{
|
{
|
||||||
if (contract && _other.contract)
|
return
|
||||||
if (contract->id() != _other.contract->id())
|
std::make_pair(contract ? contract->id() : -1, function->id()) <
|
||||||
return contract->id() < _other.contract->id();
|
std::make_pair(_other.contract ? _other.contract->id() : -1, _other.function->id());
|
||||||
|
|
||||||
return function->id() < _other.function->id();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
explicit CFG(langutil::ErrorReporter& _errorReporter): m_errorReporter(_errorReporter) {}
|
explicit CFG(langutil::ErrorReporter& _errorReporter): m_errorReporter(_errorReporter) {}
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
contract C0 {
|
||||||
|
function f() external {}
|
||||||
|
function f(int) external {}
|
||||||
|
function f2() external {}
|
||||||
|
}
|
||||||
|
function f() {}
|
||||||
|
contract C {
|
||||||
|
function f() external {}
|
||||||
|
}
|
||||||
|
contract C2 is C0 {}
|
||||||
|
// ----
|
||||||
|
// Warning 2519: (16-40): This declaration shadows an existing declaration.
|
||||||
|
// Warning 2519: (43-70): This declaration shadows an existing declaration.
|
||||||
|
// Warning 2519: (132-156): This declaration shadows an existing declaration.
|
Loading…
Reference in New Issue
Block a user