Fix ABI internal compiler error caused by an internal constructor

This commit is contained in:
a3d4 2020-05-07 05:33:08 +02:00
parent 5e46ef7df5
commit 5e9502bfae
3 changed files with 13 additions and 2 deletions

View File

@ -9,6 +9,7 @@ Compiler Features:
Bugfixes: Bugfixes:
* ABI: Skip ``private`` or ``internal`` constructors.

View File

@ -73,9 +73,10 @@ Json::Value ABI::generate(ContractDefinition const& _contractDef)
); );
abi.emplace(std::move(method)); abi.emplace(std::move(method));
} }
if (_contractDef.constructor()) FunctionDefinition const* constructor = _contractDef.constructor();
if (constructor && constructor->visibility() >= Visibility::Public)
{ {
FunctionType constrType(*_contractDef.constructor()); FunctionType constrType(*constructor);
FunctionType const* externalFunctionType = constrType.interfaceFunctionType(); FunctionType const* externalFunctionType = constrType.interfaceFunctionType();
solAssert(!!externalFunctionType, ""); solAssert(!!externalFunctionType, "");
Json::Value method; Json::Value method;

View File

@ -0,0 +1,9 @@
// bug #8712
contract B {
uint immutable x;
constructor(function() internal returns(uint) fp) internal {
x = fp(); }
}
// ----
// :B
// []