mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Do not assume successful analysis on fatal error.
This commit is contained in:
parent
53c305ea80
commit
33c12e2195
@ -620,6 +620,8 @@ bool CompilerStack::analyze()
|
|||||||
modelChecker.analyze(*source->ast);
|
modelChecker.analyze(*source->ast);
|
||||||
m_unhandledSMTLib2Queries += modelChecker.unhandledQueries();
|
m_unhandledSMTLib2Queries += modelChecker.unhandledQueries();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_stackState = AnalysisPerformed;
|
||||||
}
|
}
|
||||||
catch (FatalError const&)
|
catch (FatalError const&)
|
||||||
{
|
{
|
||||||
@ -628,7 +630,6 @@ bool CompilerStack::analyze()
|
|||||||
noErrors = false;
|
noErrors = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_stackState = AnalysisPerformed;
|
|
||||||
if (!noErrors)
|
if (!noErrors)
|
||||||
m_hasError = true;
|
m_hasError = true;
|
||||||
|
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"language": "Solidity",
|
||||||
|
"sources":
|
||||||
|
{
|
||||||
|
"A":
|
||||||
|
{
|
||||||
|
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\nstruct S { S s; } contract C { event E(S); }"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"settings":
|
||||||
|
{
|
||||||
|
"parserErrorRecovery": true,
|
||||||
|
"outputSelection": { "*": { "": ["ast"] } }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,197 @@
|
|||||||
|
{
|
||||||
|
"errors":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"component": "general",
|
||||||
|
"errorCode": "2046",
|
||||||
|
"formattedMessage": "TypeError: Recursive struct definition.
|
||||||
|
--> A:3:1:
|
||||||
|
|
|
||||||
|
3 | struct S { S s; } contract C { event E(S); }
|
||||||
|
| ^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
",
|
||||||
|
"message": "Recursive struct definition.",
|
||||||
|
"severity": "error",
|
||||||
|
"sourceLocation":
|
||||||
|
{
|
||||||
|
"end": 76,
|
||||||
|
"file": "A",
|
||||||
|
"start": 59
|
||||||
|
},
|
||||||
|
"type": "TypeError"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sources":
|
||||||
|
{
|
||||||
|
"A":
|
||||||
|
{
|
||||||
|
"ast":
|
||||||
|
{
|
||||||
|
"absolutePath": "A",
|
||||||
|
"exportedSymbols":
|
||||||
|
{
|
||||||
|
"C":
|
||||||
|
[
|
||||||
|
11
|
||||||
|
],
|
||||||
|
"S":
|
||||||
|
[
|
||||||
|
5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"id": 12,
|
||||||
|
"license": "GPL-3.0",
|
||||||
|
"nodeType": "SourceUnit",
|
||||||
|
"nodes":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"literals":
|
||||||
|
[
|
||||||
|
"solidity",
|
||||||
|
">=",
|
||||||
|
"0.0"
|
||||||
|
],
|
||||||
|
"nodeType": "PragmaDirective",
|
||||||
|
"src": "36:22:0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"canonicalName": "S",
|
||||||
|
"id": 5,
|
||||||
|
"members":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"constant": false,
|
||||||
|
"id": 4,
|
||||||
|
"mutability": "mutable",
|
||||||
|
"name": "s",
|
||||||
|
"nameLocation": "72:1:0",
|
||||||
|
"nodeType": "VariableDeclaration",
|
||||||
|
"scope": 5,
|
||||||
|
"src": "70:3:0",
|
||||||
|
"stateVariable": false,
|
||||||
|
"storageLocation": "default",
|
||||||
|
"typeDescriptions":
|
||||||
|
{
|
||||||
|
"typeIdentifier": "t_struct$_S_$5_storage_ptr",
|
||||||
|
"typeString": "struct S"
|
||||||
|
},
|
||||||
|
"typeName":
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"nodeType": "UserDefinedTypeName",
|
||||||
|
"pathNode":
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"name": "S",
|
||||||
|
"nameLocations":
|
||||||
|
[
|
||||||
|
"70:1:0"
|
||||||
|
],
|
||||||
|
"nodeType": "IdentifierPath",
|
||||||
|
"referencedDeclaration": 5,
|
||||||
|
"src": "70:1:0"
|
||||||
|
},
|
||||||
|
"referencedDeclaration": 5,
|
||||||
|
"src": "70:1:0",
|
||||||
|
"typeDescriptions":
|
||||||
|
{
|
||||||
|
"typeIdentifier": "t_struct$_S_$5_storage_ptr",
|
||||||
|
"typeString": "struct S"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"visibility": "internal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "S",
|
||||||
|
"nameLocation": "66:1:0",
|
||||||
|
"nodeType": "StructDefinition",
|
||||||
|
"scope": 12,
|
||||||
|
"src": "59:17:0",
|
||||||
|
"visibility": "public"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"abstract": false,
|
||||||
|
"baseContracts": [],
|
||||||
|
"canonicalName": "C",
|
||||||
|
"contractDependencies": [],
|
||||||
|
"contractKind": "contract",
|
||||||
|
"id": 11,
|
||||||
|
"linearizedBaseContracts":
|
||||||
|
[
|
||||||
|
11
|
||||||
|
],
|
||||||
|
"name": "C",
|
||||||
|
"nameLocation": "86:1:0",
|
||||||
|
"nodeType": "ContractDefinition",
|
||||||
|
"nodes":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"id": 10,
|
||||||
|
"name": "E",
|
||||||
|
"nameLocation": "96:1:0",
|
||||||
|
"nodeType": "EventDefinition",
|
||||||
|
"parameters":
|
||||||
|
{
|
||||||
|
"id": 9,
|
||||||
|
"nodeType": "ParameterList",
|
||||||
|
"parameters":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"constant": false,
|
||||||
|
"id": 8,
|
||||||
|
"indexed": false,
|
||||||
|
"mutability": "mutable",
|
||||||
|
"name": "",
|
||||||
|
"nameLocation": "-1:-1:-1",
|
||||||
|
"nodeType": "VariableDeclaration",
|
||||||
|
"scope": 10,
|
||||||
|
"src": "98:1:0",
|
||||||
|
"stateVariable": false,
|
||||||
|
"storageLocation": "default",
|
||||||
|
"typeDescriptions": {},
|
||||||
|
"typeName":
|
||||||
|
{
|
||||||
|
"id": 7,
|
||||||
|
"nodeType": "UserDefinedTypeName",
|
||||||
|
"pathNode":
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"name": "S",
|
||||||
|
"nameLocations":
|
||||||
|
[
|
||||||
|
"98:1:0"
|
||||||
|
],
|
||||||
|
"nodeType": "IdentifierPath",
|
||||||
|
"referencedDeclaration": 5,
|
||||||
|
"src": "98:1:0"
|
||||||
|
},
|
||||||
|
"referencedDeclaration": 5,
|
||||||
|
"src": "98:1:0",
|
||||||
|
"typeDescriptions": {}
|
||||||
|
},
|
||||||
|
"visibility": "internal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"src": "97:3:0"
|
||||||
|
},
|
||||||
|
"src": "90:11:0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"scope": 12,
|
||||||
|
"src": "77:26:0",
|
||||||
|
"usedErrors": [],
|
||||||
|
"usedEvents":
|
||||||
|
[
|
||||||
|
10
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"src": "36:67:0"
|
||||||
|
},
|
||||||
|
"id": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user