mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2527 from ethereum/onlyASTIfAnalysisSuccessful
Only output AST if the analysis was successful.
This commit is contained in:
commit
2dd9070a4f
@ -1,6 +1,7 @@
|
|||||||
### 0.4.13 (unreleased)
|
### 0.4.13 (unreleased)
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
* Compiler Interface: Only output AST if analysis was successful.
|
||||||
* Code Generator: Correctly unregister modifier variables.
|
* Code Generator: Correctly unregister modifier variables.
|
||||||
* Error Output: Do not omit the error type.
|
* Error Output: Do not omit the error type.
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
|||||||
if (errors.size() > 0)
|
if (errors.size() > 0)
|
||||||
output["errors"] = errors;
|
output["errors"] = errors;
|
||||||
|
|
||||||
bool parsingSuccess = m_compilerStack.state() >= CompilerStack::State::ParsingSuccessful;
|
bool analysisSuccess = m_compilerStack.state() >= CompilerStack::State::AnalysisSuccessful;
|
||||||
bool compilationSuccess = m_compilerStack.state() == CompilerStack::State::CompilationSuccessful;
|
bool compilationSuccess = m_compilerStack.state() == CompilerStack::State::CompilationSuccessful;
|
||||||
|
|
||||||
/// Inconsistent state - stop here to receive error reports from users
|
/// Inconsistent state - stop here to receive error reports from users
|
||||||
@ -366,7 +366,7 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
|||||||
|
|
||||||
output["sources"] = Json::objectValue;
|
output["sources"] = Json::objectValue;
|
||||||
unsigned sourceIndex = 0;
|
unsigned sourceIndex = 0;
|
||||||
for (auto const& source: parsingSuccess ? m_compilerStack.sourceNames() : vector<string>())
|
for (auto const& source: analysisSuccess ? m_compilerStack.sourceNames() : vector<string>())
|
||||||
{
|
{
|
||||||
Json::Value sourceResult = Json::objectValue;
|
Json::Value sourceResult = Json::objectValue;
|
||||||
sourceResult["id"] = sourceIndex++;
|
sourceResult["id"] = sourceIndex++;
|
||||||
|
Loading…
Reference in New Issue
Block a user