diff options
-rw-r--r-- | liblangutil/SourceLocation.h | 8 | ||||
-rw-r--r-- | test/libsolidity/Assembly.cpp | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/liblangutil/SourceLocation.h b/liblangutil/SourceLocation.h index 732a32e1..2d18a7d1 100644 --- a/liblangutil/SourceLocation.h +++ b/liblangutil/SourceLocation.h @@ -44,9 +44,7 @@ struct SourceLocation bool operator==(SourceLocation const& _other) const { - return start == _other.start && end == _other.end && - ((!source.get() && !_other.source.get()) || - (source.get() && _other.source.get() && source->name() == _other.source->name())); + return source.get() == _other.source.get() && start == _other.start && end == _other.end; } bool operator!=(SourceLocation const& _other) const { return !operator==(_other); } inline bool operator<(SourceLocation const& _other) const; @@ -84,14 +82,14 @@ bool SourceLocation::operator<(SourceLocation const& _other) const bool SourceLocation::contains(SourceLocation const& _other) const { - if (isEmpty() || _other.isEmpty() || ((!source || !_other.source || source->name() != _other.source->name()) && (source || _other.source))) + if (isEmpty() || _other.isEmpty() || source.get() != _other.source.get()) return false; return start <= _other.start && _other.end <= end; } bool SourceLocation::intersects(SourceLocation const& _other) const { - if (isEmpty() || _other.isEmpty() || ((!source || !_other.source || source->name() != _other.source->name()) && (source || _other.source))) + if (isEmpty() || _other.isEmpty() || source.get() != _other.source.get()) return false; return _other.start < end && start < _other.end; } diff --git a/test/libsolidity/Assembly.cpp b/test/libsolidity/Assembly.cpp index 004917d4..aa10147c 100644 --- a/test/libsolidity/Assembly.cpp +++ b/test/libsolidity/Assembly.cpp @@ -135,7 +135,8 @@ void checkAssemblyLocations(AssemblyItems const& _items, vector<SourceLocation> BOOST_CHECK_EQUAL(_items.size(), _locations.size()); for (size_t i = 0; i < min(_items.size(), _locations.size()); ++i) { - if (_items[i].location() != _locations[i]) + if (_items[i].location().start != _locations[i].start || + _items[i].location().end != _locations[i].end) { BOOST_CHECK_MESSAGE(false, "Location mismatch for item " + to_string(i) + ". Found the following locations:"); printAssemblyLocations(_items); |