From da48bcc51e56d7a088b8e21c45aa12299babbd39 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 5 Jul 2017 18:24:51 +0200 Subject: Only output AST if the analysis was successful. --- libsolidity/interface/StandardCompiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libsolidity/interface/StandardCompiler.cpp') diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index e677afc8..4aeabbdd 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -357,7 +357,7 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input) if (errors.size() > 0) 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; /// 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; unsigned sourceIndex = 0; - for (auto const& source: parsingSuccess ? m_compilerStack.sourceNames() : vector()) + for (auto const& source: analysisSuccess ? m_compilerStack.sourceNames() : vector()) { Json::Value sourceResult = Json::objectValue; sourceResult["id"] = sourceIndex++; -- cgit From 75f7f7e1e69329ec0413e51979fefd23c9b982f7 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 5 Jul 2017 17:02:02 +0200 Subject: Do not omit error type. --- libsolidity/interface/StandardCompiler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libsolidity/interface/StandardCompiler.cpp') diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index e677afc8..1f51851d 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -71,7 +71,7 @@ Json::Value formatErrorWithException( ) { string message; - string formattedMessage = SourceReferenceFormatter::formatExceptionInformation(_exception, _message, _scannerFromSourceName); + string formattedMessage = SourceReferenceFormatter::formatExceptionInformation(_exception, _type, _scannerFromSourceName); // NOTE: the below is partially a copy from SourceReferenceFormatter SourceLocation const* location = boost::get_error_info(_exception); @@ -271,12 +271,12 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input) for (auto const& error: m_compilerStack.errors()) { - auto err = dynamic_pointer_cast(error); + Error const& err = dynamic_cast(*error); errors.append(formatErrorWithException( *error, - err->type() == Error::Type::Warning, - err->typeName(), + err.type() == Error::Type::Warning, + err.typeName(), "general", "", scannerFromSourceName -- cgit