Merge pull request #10753 from ethereum/ir-negate

Fix YulUtilFunctions::negateNumberWrappingFunction
This commit is contained in:
chriseth 2021-01-14 10:48:15 +01:00 committed by GitHub
commit afbf68f79c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -3765,7 +3765,7 @@ string YulUtilFunctions::negateNumberWrappingFunction(Type const& _type)
return m_functionCollector.createFunction(functionName, [&]() { return m_functionCollector.createFunction(functionName, [&]() {
return Whiskers(R"( return Whiskers(R"(
function <functionName>(value) -> ret { function <functionName>(value) -> ret {
value := <cleanupFunction>(sub(0, value))) ret := <cleanupFunction>(sub(0, value))
} }
)") )")
("functionName", functionName) ("functionName", functionName)

View File

@ -6,5 +6,7 @@ contract test {
} }
} }
// ====
// compileViaYul: also
// ---- // ----
// f() -> true // f() -> true