Fix crash when FunctionType has undeclared type as parameter

This commit is contained in:
Leonardo Alt 2018-07-30 16:43:50 +02:00
parent bc13365a7b
commit 210fee571f
9 changed files with 38 additions and 12 deletions

View File

@ -73,6 +73,7 @@ Bugfixes:
* Code Generator: Fix allocation of byte arrays (zeroed out too much memory).
* Fix NatSpec json output for `@notice` and `@dev` tags on contract definitions.
* References Resolver: Enforce ``storage`` as data location for mappings.
* References Resolver: Report error instead of assertion fail when FunctionType has an undeclared type as parameter.
* Type Checker: Consider fixed size arrays when checking for recursive structs.
* Type System: Allow arbitrary exponents for literals with a mantissa of zero.

View File

@ -144,7 +144,7 @@ void ReferencesResolver::endVisit(UserDefinedTypeName const& _typeName)
Declaration const* declaration = m_resolver.pathFromCurrentScope(_typeName.namePath());
if (!declaration)
{
declarationError(_typeName.location(), "Identifier not found or not unique.");
fatalDeclarationError(_typeName.location(), "Identifier not found or not unique.");
return;
}

View File

@ -1,11 +0,0 @@
contract test {
function f() public {
uintM something = 3;
intM should = 4;
bytesM fail = "now";
}
}
// ----
// DeclarationError: (50-55): Identifier not found or not unique.
// DeclarationError: (79-83): Identifier not found or not unique.
// DeclarationError: (104-110): Identifier not found or not unique.

View File

@ -0,0 +1,7 @@
contract test {
function f() public {
uintM something = 3;
}
}
// ----
// DeclarationError: (50-55): Identifier not found or not unique.

View File

@ -0,0 +1,7 @@
contract test {
function f() public {
intM should = 4;
}
}
// ----
// DeclarationError: (50-54): Identifier not found or not unique.

View File

@ -0,0 +1,7 @@
contract test {
function f() public {
bytesM fail = "now";
}
}
// ----
// DeclarationError: (50-56): Identifier not found or not unique.

View File

@ -0,0 +1,5 @@
contract C {
function a(function(Nested)) external pure {}
}
// ----
// DeclarationError: (37-43): Identifier not found or not unique.

View File

@ -0,0 +1,5 @@
contract C {
function a(function(Nested) external) external pure {}
}
// ----
// DeclarationError: (37-43): Identifier not found or not unique.

View File

@ -0,0 +1,5 @@
contract C {
function a(function(function(function(Nested)))) external pure {}
}
// ----
// DeclarationError: (55-61): Identifier not found or not unique.