mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Restrict linkersymbol
builtin to object dialect of Yul
This commit is contained in:
parent
b0bc747000
commit
356b9a7904
@ -124,6 +124,8 @@ map<YulString, BuiltinFunctionForEVM> createBuiltins(langutil::EVMVersion _evmVe
|
|||||||
)
|
)
|
||||||
builtins.emplace(createEVMFunction(instr.first, instr.second));
|
builtins.emplace(createEVMFunction(instr.first, instr.second));
|
||||||
|
|
||||||
|
if (_objectAccess)
|
||||||
|
{
|
||||||
builtins.emplace(createFunction("linkersymbol", 1, 1, SideEffects{}, {true}, [](
|
builtins.emplace(createFunction("linkersymbol", 1, 1, SideEffects{}, {true}, [](
|
||||||
FunctionCall const& _call,
|
FunctionCall const& _call,
|
||||||
AbstractAssembly& _assembly,
|
AbstractAssembly& _assembly,
|
||||||
@ -134,9 +136,6 @@ map<YulString, BuiltinFunctionForEVM> createBuiltins(langutil::EVMVersion _evmVe
|
|||||||
Expression const& arg = _call.arguments.front();
|
Expression const& arg = _call.arguments.front();
|
||||||
_assembly.appendLinkerSymbol(std::get<Literal>(arg).value.str());
|
_assembly.appendLinkerSymbol(std::get<Literal>(arg).value.str());
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (_objectAccess)
|
|
||||||
{
|
|
||||||
builtins.emplace(createFunction("datasize", 1, 1, SideEffects{}, {true}, [](
|
builtins.emplace(createFunction("datasize", 1, 1, SideEffects{}, {true}, [](
|
||||||
FunctionCall const& _call,
|
FunctionCall const& _call,
|
||||||
AbstractAssembly& _assembly,
|
AbstractAssembly& _assembly,
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
contract C {
|
||||||
|
function f() public pure {
|
||||||
|
assembly {
|
||||||
|
pop(linkersymbol("contract/library.sol:L"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// DeclarationError 4619: (67-79): Function not found.
|
||||||
|
// TypeError 3950: (67-105): Expected expression to evaluate to one value, but got 0 values instead.
|
@ -0,0 +1,10 @@
|
|||||||
|
contract C {
|
||||||
|
function f() public pure {
|
||||||
|
assembly {
|
||||||
|
function linkersymbol(a) {}
|
||||||
|
|
||||||
|
linkersymbol("contract/library.sol:L")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
Loading…
Reference in New Issue
Block a user