aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-10-02 18:41:47 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-10-02 18:41:47 +0800
commit71aca8c86d3721bcbf21f1f1649f07cf732f2090 (patch)
tree536ad5b2656566d7139e07eb8f313baac3fe66bd
parentba7c5d2305d3486ddd699637a881ee229627082f (diff)
downloaddexon-solidity-71aca8c86d3721bcbf21f1f1649f07cf732f2090.tar
dexon-solidity-71aca8c86d3721bcbf21f1f1649f07cf732f2090.tar.gz
dexon-solidity-71aca8c86d3721bcbf21f1f1649f07cf732f2090.tar.bz2
dexon-solidity-71aca8c86d3721bcbf21f1f1649f07cf732f2090.tar.lz
dexon-solidity-71aca8c86d3721bcbf21f1f1649f07cf732f2090.tar.xz
dexon-solidity-71aca8c86d3721bcbf21f1f1649f07cf732f2090.tar.zst
dexon-solidity-71aca8c86d3721bcbf21f1f1649f07cf732f2090.zip
Always return a valid pointer in Exception::what()
-rw-r--r--libdevcore/Exceptions.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libdevcore/Exceptions.cpp b/libdevcore/Exceptions.cpp
index f422d926..25fd1478 100644
--- a/libdevcore/Exceptions.cpp
+++ b/libdevcore/Exceptions.cpp
@@ -27,7 +27,9 @@ char const* Exception::what() const noexcept
if (string const* cmt = comment())
return cmt->c_str();
else
- return nullptr;
+ /// Boost accepts nullptr, but the C++ standard doesn't
+ /// and crashes on some platforms.
+ return std::exception::what();
}
string Exception::lineInfo() const