mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Style and some assertion messages.
This commit is contained in:
parent
e2d6e34f9c
commit
aa6182ab87
@ -481,7 +481,7 @@ void CompilerUtils::convertType(Type const& _typeOnStack, Type const& _targetTyp
|
||||
}
|
||||
break;
|
||||
case DataLocation::CallData:
|
||||
solAssert(false, "");
|
||||
solAssert(false, "Invalid type conversion target location CallData.");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -324,7 +324,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
||||
FunctionTypePointer functionType;
|
||||
if (_functionCall.isStructConstructorCall())
|
||||
{
|
||||
TypeType const& type = dynamic_cast<TypeType const&>(*_functionCall.getExpression().getType());
|
||||
auto const& type = dynamic_cast<TypeType const&>(*_functionCall.getExpression().getType());
|
||||
auto const& structType = dynamic_cast<StructType const&>(*type.getActualType());
|
||||
functionType = structType.constructorType();
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ void StorageItem::storeValue(Type const& _sourceType, SourceLocation const& _loc
|
||||
else if (sourceType.getSizeOnStack() >= 1)
|
||||
{
|
||||
// remove the source ref
|
||||
solAssert(sourceStackSize <= 2, "");
|
||||
solAssert(sourceStackSize <= 2, "Invalid stack size.");
|
||||
m_context << eth::swapInstruction(sourceStackSize);
|
||||
if (sourceStackSize == 2)
|
||||
m_context << eth::Instruction::POP;
|
||||
|
@ -1020,13 +1020,10 @@ bool StructType::canLiveOutsideStorage() const
|
||||
|
||||
unsigned StructType::getSizeOnStack() const
|
||||
{
|
||||
switch (location())
|
||||
{
|
||||
case DataLocation::Storage:
|
||||
if (location() == DataLocation::Storage)
|
||||
return 2; // slot and offset
|
||||
default:
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
string StructType::toString(bool _short) const
|
||||
|
Loading…
Reference in New Issue
Block a user