diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-12-12 18:14:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-12 18:14:06 +0800 |
commit | 55e9af2f20f04d1f75291850c92c18364c8c2683 (patch) | |
tree | b148f35f2969e0004b6d96718cb41792b644ce3b /libsolidity/interface/Exceptions.h | |
parent | 14707b27e23a640274ce507c1c9a3d862f2c2b7f (diff) | |
parent | 2d171c25e57e821c242b2a6ffa9d6e890e8b207e (diff) | |
download | dexon-solidity-55e9af2f20f04d1f75291850c92c18364c8c2683.tar dexon-solidity-55e9af2f20f04d1f75291850c92c18364c8c2683.tar.gz dexon-solidity-55e9af2f20f04d1f75291850c92c18364c8c2683.tar.bz2 dexon-solidity-55e9af2f20f04d1f75291850c92c18364c8c2683.tar.lz dexon-solidity-55e9af2f20f04d1f75291850c92c18364c8c2683.tar.xz dexon-solidity-55e9af2f20f04d1f75291850c92c18364c8c2683.tar.zst dexon-solidity-55e9af2f20f04d1f75291850c92c18364c8c2683.zip |
Merge pull request #3310 from ethereum/limitDecl
Limit number of secondary source locations.
Diffstat (limited to 'libsolidity/interface/Exceptions.h')
-rw-r--r-- | libsolidity/interface/Exceptions.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libsolidity/interface/Exceptions.h b/libsolidity/interface/Exceptions.h index 09301b10..7c66d572 100644 --- a/libsolidity/interface/Exceptions.h +++ b/libsolidity/interface/Exceptions.h @@ -109,6 +109,18 @@ public: infos.push_back(std::make_pair(_errMsg, _sourceLocation)); return *this; } + /// Limits the number of secondary source locations to 32 and appends a notice to the + /// error message. + void limitSize(std::string& _message) + { + size_t occurrences = infos.size(); + if (occurrences > 32) + { + infos.resize(32); + _message += " Truncated from " + boost::lexical_cast<std::string>(occurrences) + " to the first 32 occurrences."; + } + } + std::vector<errorSourceLocationInfo> infos; }; |