mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Small fixes in Types and ExpressionCompiler
This commit is contained in:
parent
f6586b8139
commit
afe1d9a592
@ -860,8 +860,8 @@ unsigned ExpressionCompiler::appendArgumentsCopyToMemory(vector<ASTPointer<Expre
|
|||||||
|
|
||||||
unsigned ExpressionCompiler::moveTypeToMemory(Type const& _type, Location const& _location, unsigned _memoryOffset, bool _padToWordBoundaries)
|
unsigned ExpressionCompiler::moveTypeToMemory(Type const& _type, Location const& _location, unsigned _memoryOffset, bool _padToWordBoundaries)
|
||||||
{
|
{
|
||||||
unsigned const encodedSize = _type.getCalldataEncodedSize();
|
unsigned const c_encodedSize = _type.getCalldataEncodedSize();
|
||||||
unsigned const c_numBytes = _padToWordBoundaries ? CompilerUtils::getPaddedSize(encodedSize) : encodedSize;
|
unsigned const c_numBytes = _padToWordBoundaries ? CompilerUtils::getPaddedSize(c_encodedSize) : c_encodedSize;
|
||||||
if (c_numBytes == 0 || c_numBytes > 32)
|
if (c_numBytes == 0 || c_numBytes > 32)
|
||||||
BOOST_THROW_EXCEPTION(CompilerError()
|
BOOST_THROW_EXCEPTION(CompilerError()
|
||||||
<< errinfo_sourceLocation(_location)
|
<< errinfo_sourceLocation(_location)
|
||||||
|
@ -364,8 +364,7 @@ u256 IntegerConstantType::literalValue(Literal const* _literal) const
|
|||||||
TypePointer IntegerConstantType::getRealType() const
|
TypePointer IntegerConstantType::getRealType() const
|
||||||
{
|
{
|
||||||
auto intType = getIntegerType();
|
auto intType = getIntegerType();
|
||||||
if (!intType)
|
solAssert(!!intType, std::string("getRealType called with invalid integer constant") + toString());
|
||||||
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("getRealType called with invalid integer constant" + toString()));
|
|
||||||
return intType;
|
return intType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
Types.h
2
Types.h
@ -131,7 +131,7 @@ public:
|
|||||||
virtual bool isValueType() const { return false; }
|
virtual bool isValueType() const { return false; }
|
||||||
virtual unsigned getSizeOnStack() const { return 1; }
|
virtual unsigned getSizeOnStack() const { return 1; }
|
||||||
/// @returns the real type of some types, like e.g: IntegerConstant
|
/// @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.
|
/// Returns the list of all members of this type. Default implementation: no members.
|
||||||
virtual MemberList const& getMembers() const { return EmptyMemberList; }
|
virtual MemberList const& getMembers() const { return EmptyMemberList; }
|
||||||
|
Loading…
Reference in New Issue
Block a user