aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-08-07 18:23:00 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-08-07 19:14:12 +0800
commit296ba24f7f14811c5a5482457391d4f1afa49a87 (patch)
tree578510afaf0adb4bdb932cc29c6177b851bce06c /libsolidity
parentd33e5683f51dc9d85b4493abbf6f03f6ab7b8ff2 (diff)
downloaddexon-solidity-296ba24f7f14811c5a5482457391d4f1afa49a87.tar.gz
dexon-solidity-296ba24f7f14811c5a5482457391d4f1afa49a87.tar.zst
dexon-solidity-296ba24f7f14811c5a5482457391d4f1afa49a87.zip
Do not crash on using _slot and _offset suffixes on their own
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp5
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)