diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-08-07 19:55:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-07 19:55:40 +0800 |
commit | 8b2d630275fb29d2915af76f608be4d4e422907f (patch) | |
tree | c45a9efcec1e7a769a1a38b9eac8c8a1525fac83 /libsolidity | |
parent | 261fedd3b04fc67e4359002631d8f6b46032b85f (diff) | |
parent | 296ba24f7f14811c5a5482457391d4f1afa49a87 (diff) | |
download | dexon-solidity-8b2d630275fb29d2915af76f608be4d4e422907f.tar dexon-solidity-8b2d630275fb29d2915af76f608be4d4e422907f.tar.gz dexon-solidity-8b2d630275fb29d2915af76f608be4d4e422907f.tar.bz2 dexon-solidity-8b2d630275fb29d2915af76f608be4d4e422907f.tar.lz dexon-solidity-8b2d630275fb29d2915af76f608be4d4e422907f.tar.xz dexon-solidity-8b2d630275fb29d2915af76f608be4d4e422907f.tar.zst dexon-solidity-8b2d630275fb29d2915af76f608be4d4e422907f.zip |
Merge pull request #4724 from ethereum/slot-in-assembly
Do not crash on using _slot and _offset suffixes on their own
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/ReferencesResolver.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp index ba793933..5458c1b0 100644 --- a/libsolidity/analysis/ReferencesResolver.cpp +++ b/libsolidity/analysis/ReferencesResolver.cpp @@ -256,6 +256,11 @@ bool ReferencesResolver::visit(InlineAssembly const& _inlineAssembly) string("_slot").size() : string("_offset").size() )); + if (realName.empty()) + { + declarationError(_identifier.location, "In variable names _slot and _offset can only be used as a suffix."); + return size_t(-1); + } declarations = m_resolver.nameFromCurrentScope(realName); } if (declarations.size() != 1) |