| 4145 | } |
| 4146 | |
| 4147 | std::string YulUtilFunctions::forwardingRevertFunction() |
| 4148 | { |
| 4149 | bool forward = m_evmVersion.supportsReturndata(); |
| 4150 | std::string functionName = "revert_forward_" + std::to_string(forward); |
| 4151 | return m_functionCollector.createFunction(functionName, [&]() { |
| 4152 | if (forward) |
| 4153 | return Whiskers(R"( |
| 4154 | function <functionName>() { |
| 4155 | let pos := <allocateUnbounded>() |
| 4156 | returndatacopy(pos, 0, returndatasize()) |
| 4157 | revert(pos, returndatasize()) |
| 4158 | } |
| 4159 | )") |
| 4160 | ("functionName", functionName) |
| 4161 | ("allocateUnbounded", allocateUnboundedFunction()) |
| 4162 | .render(); |
| 4163 | else |
| 4164 | return Whiskers(R"( |
| 4165 | function <functionName>() { |
| 4166 | revert(0, 0) |
| 4167 | } |
| 4168 | )") |
| 4169 | ("functionName", functionName) |
| 4170 | .render(); |
| 4171 | }); |
| 4172 | } |
| 4173 | |
| 4174 | std::string YulUtilFunctions::decrementCheckedFunction(Type const& _type) |
| 4175 | { |
no test coverage detected