Style and some assertion messages.

This commit is contained in:
chriseth 2015-07-03 18:15:05 +02:00
parent e2d6e34f9c
commit aa6182ab87
4 changed files with 5 additions and 8 deletions

View File

@ -481,7 +481,7 @@ void CompilerUtils::convertType(Type const& _typeOnStack, Type const& _targetTyp
} }
break; break;
case DataLocation::CallData: case DataLocation::CallData:
solAssert(false, ""); solAssert(false, "Invalid type conversion target location CallData.");
break; break;
} }
break; break;

View File

@ -324,7 +324,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
FunctionTypePointer functionType; FunctionTypePointer functionType;
if (_functionCall.isStructConstructorCall()) 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()); auto const& structType = dynamic_cast<StructType const&>(*type.getActualType());
functionType = structType.constructorType(); functionType = structType.constructorType();
} }

View File

@ -294,7 +294,7 @@ void StorageItem::storeValue(Type const& _sourceType, SourceLocation const& _loc
else if (sourceType.getSizeOnStack() >= 1) else if (sourceType.getSizeOnStack() >= 1)
{ {
// remove the source ref // remove the source ref
solAssert(sourceStackSize <= 2, ""); solAssert(sourceStackSize <= 2, "Invalid stack size.");
m_context << eth::swapInstruction(sourceStackSize); m_context << eth::swapInstruction(sourceStackSize);
if (sourceStackSize == 2) if (sourceStackSize == 2)
m_context << eth::Instruction::POP; m_context << eth::Instruction::POP;

View File

@ -1020,13 +1020,10 @@ bool StructType::canLiveOutsideStorage() const
unsigned StructType::getSizeOnStack() const unsigned StructType::getSizeOnStack() const
{ {
switch (location()) if (location() == DataLocation::Storage)
{
case DataLocation::Storage:
return 2; // slot and offset return 2; // slot and offset
default: else
return 1; return 1;
}
} }
string StructType::toString(bool _short) const string StructType::toString(bool _short) const