aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-05-15 19:04:49 +0800
committerchriseth <chris@ethereum.org>2018-05-15 20:45:54 +0800
commitdac0029d16ffe31fba2e6241f99893ea9a26926e (patch)
tree1e68ea5ff7ab7b10bf2bf59195676ff7feac8524 /libsolidity/analysis
parentdce62240525035ec7ce6b5d1b76bfeebe1ae9546 (diff)
downloaddexon-solidity-dac0029d16ffe31fba2e6241f99893ea9a26926e.tar.gz
dexon-solidity-dac0029d16ffe31fba2e6241f99893ea9a26926e.tar.zst
dexon-solidity-dac0029d16ffe31fba2e6241f99893ea9a26926e.zip
ABI encoding functions are pure and should be usable in constants.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index a222bdf0..e8694e88 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -2093,6 +2093,9 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
if (auto tt = dynamic_cast<TypeType const*>(exprType.get()))
if (tt->actualType()->category() == Type::Category::Enum)
annotation.isPure = true;
+ if (auto magicType = dynamic_cast<MagicType const*>(exprType.get()))
+ if (magicType->kind() == MagicType::Kind::ABI)
+ annotation.isPure = true;
return false;
}