| 91 | } |
| 92 | |
| 93 | void CompilerUtils::revertWithStringData(Type const& _argumentType) |
| 94 | { |
| 95 | solAssert(_argumentType.isImplicitlyConvertibleTo(*TypeProvider::fromElementaryTypeName("string memory"))); |
| 96 | fetchFreeMemoryPointer(); |
| 97 | m_context << util::selectorFromSignatureU256("Error(string)"); |
| 98 | m_context << Instruction::DUP2 << Instruction::MSTORE; |
| 99 | m_context << u256(4) << Instruction::ADD; |
| 100 | // Stack: <string data> <mem pos of encoding start> |
| 101 | abiEncode({&_argumentType}, {TypeProvider::array(DataLocation::Memory, true)}); |
| 102 | toSizeAfterFreeMemoryPointer(); |
| 103 | m_context << Instruction::REVERT; |
| 104 | } |
| 105 | |
| 106 | void CompilerUtils::revertWithError( |
| 107 | std::string const& _signature, |
no test coverage detected