Merge pull request #8766 from ethereum/sol_yul_gasleft

[Sol - Yul] Add support for built-in gasleft().
This commit is contained in:
chriseth 2020-04-24 14:24:01 +02:00 committed by GitHub
commit 2b39f3b988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -771,6 +771,11 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall)
{
break;
}
case FunctionType::Kind::GasLeft:
{
define(_functionCall) << "gas()\n";
break;
}
default:
solUnimplemented("FunctionKind " + toString(static_cast<int>(functionType->kind())) + " not yet implemented");
}

View File

@ -15,6 +15,8 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f() -> true
// g() -> true