Browse Source

Style and some assertion messages.

cl-refactor
chriseth 10 years ago
parent
commit
c7f8bcf9c5
  1. 2
      libsolidity/CompilerUtils.cpp
  2. 2
      libsolidity/ExpressionCompiler.cpp
  3. 2
      libsolidity/LValue.cpp
  4. 7
      libsolidity/Types.cpp

2
libsolidity/CompilerUtils.cpp

@ -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;

2
libsolidity/ExpressionCompiler.cpp

@ -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();
} }

2
libsolidity/LValue.cpp

@ -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;

7
libsolidity/Types.cpp

@ -1020,14 +1020,11 @@ 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
{ {

Loading…
Cancel
Save