aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-03-31 19:05:32 +0800
committerchriseth <c@ethdev.com>2016-03-31 19:05:41 +0800
commite31ecc8f77432197e99b4ee966d4b1f75b0f4b02 (patch)
tree78d07115690e5a7b9324eb67419c8ea136711551 /libsolidity/interface
parent2acdfc527e4be019ecacf2487f479cca9585bea1 (diff)
downloaddexon-solidity-e31ecc8f77432197e99b4ee966d4b1f75b0f4b02.tar.gz
dexon-solidity-e31ecc8f77432197e99b4ee966d4b1f75b0f4b02.tar.zst
dexon-solidity-e31ecc8f77432197e99b4ee966d4b1f75b0f4b02.zip
Do not use source reference if it is empty.
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/SourceReferenceFormatter.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/libsolidity/interface/SourceReferenceFormatter.cpp b/libsolidity/interface/SourceReferenceFormatter.cpp
index 65d7fbc8..7b91dd2c 100644
--- a/libsolidity/interface/SourceReferenceFormatter.cpp
+++ b/libsolidity/interface/SourceReferenceFormatter.cpp
@@ -91,7 +91,7 @@ void SourceReferenceFormatter::printExceptionInformation(
auto secondarylocation = boost::get_error_info<errinfo_secondarySourceLocation>(_exception);
Scanner const* scannerPtr = nullptr;
- if (location)
+ if (location && location->sourceName)
{
scannerPtr = &_scannerFromSourceName(*location->sourceName);
printSourceName(_stream, *location, *scannerPtr);
@@ -101,7 +101,7 @@ void SourceReferenceFormatter::printExceptionInformation(
if (string const* description = boost::get_error_info<errinfo_comment>(_exception))
_stream << ": " << *description << endl;
- if (location)
+ if (location && location->sourceName)
{
scannerPtr = &_scannerFromSourceName(*location->sourceName);
printSourceLocation(_stream, *location, *scannerPtr);
@@ -111,8 +111,13 @@ void SourceReferenceFormatter::printExceptionInformation(
{
for (auto info: secondarylocation->infos)
{
- scannerPtr = &_scannerFromSourceName(*info.second.sourceName);
_stream << info.first << " ";
+ if (!info.second.sourceName)
+ {
+ _stream << endl;
+ continue;
+ }
+ scannerPtr = &_scannerFromSourceName(*info.second.sourceName);
printSourceName(_stream, info.second, *scannerPtr);
_stream << endl;
printSourceLocation(_stream, info.second, *scannerPtr);