mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix accessing constants at file level from inline assembly.
This commit is contained in:
parent
fe344ed6e5
commit
30305ebbd9
@ -111,19 +111,15 @@ private:
|
||||
solUnimplementedAssert(varDecl, "");
|
||||
string const& suffix = reference.suffix;
|
||||
|
||||
if (suffix.empty() && !varDecl->isStateVariable())
|
||||
string value;
|
||||
if (suffix.empty() && varDecl->isLocalVariable())
|
||||
{
|
||||
auto const& var = m_context.localVariable(*varDecl);
|
||||
solAssert(var.type().sizeOnStack() == 1, "");
|
||||
|
||||
return yul::Identifier{
|
||||
_identifier.location,
|
||||
yul::YulString{var.commaSeparatedList()}
|
||||
};
|
||||
value = var.commaSeparatedList();
|
||||
}
|
||||
|
||||
string value;
|
||||
if (varDecl->isConstant())
|
||||
else if (varDecl->isConstant())
|
||||
{
|
||||
VariableDeclaration const* variable = rootConstVariableDeclaration(*varDecl);
|
||||
solAssert(variable, "");
|
||||
|
@ -5,5 +5,7 @@ contract C {
|
||||
assembly { z := e }
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 0x1212121212121212121212121000002134593163
|
||||
|
Loading…
Reference in New Issue
Block a user