aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-19 22:13:49 +0800
committerchriseth <chris@ethereum.org>2018-02-19 22:13:49 +0800
commit305d5f70c25d63d602477c6b576b2f62d388c032 (patch)
treefe2b3413b7dfe832e74278a0ce695beb6e4953c7
parentd7532f7b9c33cd191f400e9af34f4f06a4aef0fa (diff)
downloaddexon-solidity-305d5f70c25d63d602477c6b576b2f62d388c032.tar.gz
dexon-solidity-305d5f70c25d63d602477c6b576b2f62d388c032.tar.zst
dexon-solidity-305d5f70c25d63d602477c6b576b2f62d388c032.zip
Fix scannerFromSourceName use-after-free.
-rw-r--r--libsolidity/interface/SourceReferenceFormatter.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/interface/SourceReferenceFormatter.h b/libsolidity/interface/SourceReferenceFormatter.h
index c212f822..a32babdc 100644
--- a/libsolidity/interface/SourceReferenceFormatter.h
+++ b/libsolidity/interface/SourceReferenceFormatter.h
@@ -45,10 +45,10 @@ public:
explicit SourceReferenceFormatter(
std::ostream& _stream,
- ScannerFromSourceNameFun const& _scannerFromSourceName
+ ScannerFromSourceNameFun _scannerFromSourceName
):
m_stream(_stream),
- m_scannerFromSourceName(_scannerFromSourceName)
+ m_scannerFromSourceName(std::move(_scannerFromSourceName))
{}
/// Prints source location if it is given.
@@ -72,7 +72,7 @@ private:
void printSourceName(SourceLocation const* _location);
std::ostream& m_stream;
- ScannerFromSourceNameFun const& m_scannerFromSourceName;
+ ScannerFromSourceNameFun m_scannerFromSourceName;
};
}