mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12016 from ethereum/external-fp-10358
Add ``.address`` and ``.selector`` in inside assembly for external function pointers
This commit is contained in:
@@ -188,6 +188,18 @@ private:
|
||||
solAssert(suffix == "offset" || suffix == "length", "");
|
||||
value = IRVariable{*varDecl}.part(suffix).name();
|
||||
}
|
||||
else if (
|
||||
auto const* functionType = dynamic_cast<FunctionType const*>(varDecl->type());
|
||||
functionType && functionType->kind() == FunctionType::Kind::External
|
||||
)
|
||||
{
|
||||
solAssert(suffix == "selector" || suffix == "address", "");
|
||||
solAssert(varDecl->type()->sizeOnStack() == 2, "");
|
||||
if (suffix == "selector")
|
||||
value = IRVariable{*varDecl}.part("functionSelector").name();
|
||||
else
|
||||
value = IRVariable{*varDecl}.part("address").name();
|
||||
}
|
||||
else
|
||||
solAssert(false, "");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user