| 2786 | } |
| 2787 | |
| 2788 | Expression const* SMTEncoder::cleanExpression(Expression const& _expr) |
| 2789 | { |
| 2790 | auto const* expr = &_expr; |
| 2791 | if (auto const* tuple = dynamic_cast<TupleExpression const*>(expr)) |
| 2792 | return cleanExpression(innermostTuple(*tuple)); |
| 2793 | if (auto const* functionCall = dynamic_cast<FunctionCall const*>(expr)) |
| 2794 | if (*functionCall->annotation().kind == FunctionCallKind::TypeConversion) |
| 2795 | { |
| 2796 | auto typeType = dynamic_cast<TypeType const*>(functionCall->expression().annotation().type); |
| 2797 | solAssert(typeType, ""); |
| 2798 | if (auto const* arrayType = dynamic_cast<ArrayType const*>(typeType->actualType())) |
| 2799 | if (arrayType->isByteArrayOrString()) |
| 2800 | { |
| 2801 | // this is a cast to `bytes` |
| 2802 | solAssert(functionCall->arguments().size() == 1, ""); |
| 2803 | Expression const& arg = *functionCall->arguments()[0]; |
| 2804 | if ( |
| 2805 | auto const* argArrayType = dynamic_cast<ArrayType const*>(arg.annotation().type); |
| 2806 | argArrayType && argArrayType->isByteArrayOrString() |
| 2807 | ) |
| 2808 | return cleanExpression(arg); |
| 2809 | } |
| 2810 | } |
| 2811 | solAssert(expr, ""); |
| 2812 | return expr; |
| 2813 | } |
| 2814 | |
| 2815 | Declaration const* SMTEncoder::expressionToDeclaration(Expression const& _expr) const |
| 2816 | { |
nothing calls this directly
no test coverage detected