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;
case DataLocation::CallData:
solAssert(false, "");
solAssert(false, "Invalid type conversion target location CallData.");
break;
}
break;

2
libsolidity/ExpressionCompiler.cpp

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

2
libsolidity/LValue.cpp

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

7
libsolidity/Types.cpp

@ -1020,14 +1020,11 @@ 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…
Cancel
Save