From 490cb5608e33051ebdf5f0a8eb259e358a44a1ae Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 6 Feb 2015 20:57:04 +0100 Subject: [PATCH] Small fixes in Types and ExpressionCompiler --- libsolidity/ExpressionCompiler.cpp | 4 ++-- libsolidity/Types.cpp | 3 +-- libsolidity/Types.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index 0ce19ecd1..cd133222c 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -860,8 +860,8 @@ unsigned ExpressionCompiler::appendArgumentsCopyToMemory(vector 32) BOOST_THROW_EXCEPTION(CompilerError() << errinfo_sourceLocation(_location) diff --git a/libsolidity/Types.cpp b/libsolidity/Types.cpp index a9051a2ca..6a1282027 100644 --- a/libsolidity/Types.cpp +++ b/libsolidity/Types.cpp @@ -364,8 +364,7 @@ u256 IntegerConstantType::literalValue(Literal const* _literal) const TypePointer IntegerConstantType::getRealType() const { auto intType = getIntegerType(); - if (!intType) - BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("getRealType called with invalid integer constant" + toString())); + solAssert(!!intType, std::string("getRealType called with invalid integer constant") + toString()); return intType; } diff --git a/libsolidity/Types.h b/libsolidity/Types.h index 677e5e49e..fcd6d9560 100644 --- a/libsolidity/Types.h +++ b/libsolidity/Types.h @@ -131,7 +131,7 @@ public: virtual bool isValueType() const { return false; } virtual unsigned getSizeOnStack() const { return 1; } /// @returns the real type of some types, like e.g: IntegerConstant - virtual TypePointer getRealType() const { return TypePointer(); } + virtual TypePointer getRealType() const { return shared_from_this(); } /// Returns the list of all members of this type. Default implementation: no members. virtual MemberList const& getMembers() const { return EmptyMemberList; }