Fix crash when passing empty strings to bytes.concat()

This commit is contained in:
Kamil Śliwak
2021-06-29 13:52:01 +02:00
parent 7bce83e7c4
commit fa3696878b
6 changed files with 36 additions and 2 deletions
+1 -1
View File
@@ -1083,7 +1083,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
targetTypes.emplace_back(argument->annotation().type);
else if (
auto const* literalType = dynamic_cast<StringLiteralType const*>(argument->annotation().type);
literalType && literalType->value().size() <= 32
literalType && !literalType->value().empty() && literalType->value().size() <= 32
)
targetTypes.emplace_back(TypeProvider::fixedBytes(static_cast<unsigned>(literalType->value().size())));
else if (auto const* literalType = dynamic_cast<RationalNumberType const*>(argument->annotation().type))