aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-02-16 18:45:06 +0800
committerchriseth <c@ethdev.com>2017-02-16 18:46:27 +0800
commitdcc16c81e26f31141ae766096873b5fd7741cdf5 (patch)
tree288bd63c517c42375d94d6de2f8afdf161d7bc0d /libsolidity/ast
parentad751bd3e6f22fadc01d43610ec2e2e008c32f11 (diff)
downloaddexon-solidity-dcc16c81e26f31141ae766096873b5fd7741cdf5.tar.gz
dexon-solidity-dcc16c81e26f31141ae766096873b5fd7741cdf5.tar.zst
dexon-solidity-dcc16c81e26f31141ae766096873b5fd7741cdf5.zip
Some checks for the existence of mobile type.
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/Types.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 5b7b4a2c..75dee6db 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -252,9 +252,9 @@ TypePointer Type::commonType(TypePointer const& _a, TypePointer const& _b)
{
if (!_a || !_b)
return TypePointer();
- else if (_b->isImplicitlyConvertibleTo(*_a->mobileType()))
+ else if (_a->mobileType() && _b->isImplicitlyConvertibleTo(*_a->mobileType()))
return _a->mobileType();
- else if (_a->isImplicitlyConvertibleTo(*_b->mobileType()))
+ else if (_b->mobileType() && _a->isImplicitlyConvertibleTo(*_b->mobileType()))
return _b->mobileType();
else
return TypePointer();
@@ -1895,7 +1895,10 @@ TypePointer TupleType::closestTemporaryType(TypePointer const& _targetType) cons
size_t si = fillRight ? i : components().size() - i - 1;
size_t ti = fillRight ? i : targetComponents.size() - i - 1;
if (components()[si] && targetComponents[ti])
+ {
tempComponents[ti] = components()[si]->closestTemporaryType(targetComponents[ti]);
+ solAssert(tempComponents[ti], "");
+ }
}
return make_shared<TupleType>(tempComponents);
}