mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix crash when passing empty strings to bytes.concat()
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user