diff --git a/libsolidity/CompilerUtils.cpp b/libsolidity/CompilerUtils.cpp index eab20e0eb..ed6a6cf7c 100644 --- a/libsolidity/CompilerUtils.cpp +++ b/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; diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index 81f5d08a5..13cd40327 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -324,7 +324,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) FunctionTypePointer functionType; if (_functionCall.isStructConstructorCall()) { - TypeType const& type = dynamic_cast(*_functionCall.getExpression().getType()); + auto const& type = dynamic_cast(*_functionCall.getExpression().getType()); auto const& structType = dynamic_cast(*type.getActualType()); functionType = structType.constructorType(); } diff --git a/libsolidity/LValue.cpp b/libsolidity/LValue.cpp index 409446638..7b5879e44 100644 --- a/libsolidity/LValue.cpp +++ b/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; diff --git a/libsolidity/Types.cpp b/libsolidity/Types.cpp index 96cf3f7ef..5a949299e 100644 --- a/libsolidity/Types.cpp +++ b/libsolidity/Types.cpp @@ -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