| 2480 | } |
| 2481 | |
| 2482 | bool SMTEncoder::sameTypeOrSubtype(Type const* _a, Type const* _b) |
| 2483 | { |
| 2484 | bool foundSame = false; |
| 2485 | |
| 2486 | solidity::util::BreadthFirstSearch<Type const*> bfs{{_a}}; |
| 2487 | bfs.run([&](auto _type, auto&& _addChild) { |
| 2488 | if (*typeWithoutPointer(_b) == *typeWithoutPointer(_type)) |
| 2489 | { |
| 2490 | foundSame = true; |
| 2491 | bfs.abort(); |
| 2492 | } |
| 2493 | if (auto const* mapType = dynamic_cast<MappingType const*>(_type)) |
| 2494 | _addChild(mapType->valueType()); |
| 2495 | else if (auto const* arrayType = dynamic_cast<ArrayType const*>(_type)) |
| 2496 | _addChild(arrayType->baseType()); |
| 2497 | else if (auto const* structType = dynamic_cast<StructType const*>(_type)) |
| 2498 | for (auto const& member: structType->nativeMembers(nullptr)) |
| 2499 | _addChild(member.type); |
| 2500 | }); |
| 2501 | |
| 2502 | return foundSame; |
| 2503 | } |
| 2504 | |
| 2505 | bool SMTEncoder::isSupportedType(Type const& _type) const |
| 2506 | { |
nothing calls this directly
no test coverage detected