aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/ReferencesResolver.cpp
diff options
context:
space:
mode:
authorVoR0220 <catalanor0220@gmail.com>2016-04-13 01:36:34 +0800
committerVoR0220 <catalanor0220@gmail.com>2016-05-10 00:41:03 +0800
commitbfc238c8d11e118443d373d819deeada9fe1ea3b (patch)
tree54076cd985d031a5a813946a678a4e6696af2117 /libsolidity/analysis/ReferencesResolver.cpp
parent5bddb2d6ffdd8a2c02a61cc304f2743f55dcb5f9 (diff)
downloaddexon-solidity-bfc238c8d11e118443d373d819deeada9fe1ea3b.tar.gz
dexon-solidity-bfc238c8d11e118443d373d819deeada9fe1ea3b.tar.zst
dexon-solidity-bfc238c8d11e118443d373d819deeada9fe1ea3b.zip
updated algorithm for bit finding...now to figure out literal value
tiny fixups changed location of the check got rid of extra space and fixed a couple of things added binary results bits change back literal value
Diffstat (limited to 'libsolidity/analysis/ReferencesResolver.cpp')
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp
index f4e0f838..9f83971b 100644
--- a/libsolidity/analysis/ReferencesResolver.cpp
+++ b/libsolidity/analysis/ReferencesResolver.cpp
@@ -104,10 +104,8 @@ void ReferencesResolver::endVisit(ArrayTypeName const& _typeName)
if (!length->annotation().type)
ConstantEvaluator e(*length);
auto const* lengthType = dynamic_cast<RationalNumberType const*>(length->annotation().type.get());
- if (!lengthType)
- fatalTypeError(length->location(), "Invalid array length.");
- else if (lengthType->denominator() != 1)
- fatalTypeError(length->location(), "Invalid input for array length, expected integer.");
+ if (!lengthType || lengthType->denominator() != 1)
+ fatalTypeError(length->location(), "Invalid array length, expected integer literal.");
else
_typeName.annotation().type = make_shared<ArrayType>(DataLocation::Storage, baseType, lengthType->literalValue(nullptr));
}