Merge pull request #11741 from ethereum/shadowing_inlineasm_fix_yul_codegen

Fixed inline assembly external identifier access.
This commit is contained in:
chriseth
2021-08-12 14:38:24 +02:00
committed by GitHub
7 changed files with 61 additions and 3 deletions
@@ -0,0 +1,12 @@
contract C {
function f() public returns (uint x) {
assembly {
function g() -> f { f := 2 }
x := g()
}
}
}
// ====
// compileViaYul: also
// ----
// f() -> 2
@@ -0,0 +1,12 @@
contract C {
function f() public returns (uint x) {
assembly {
function g() -> x {
x := 42
}
x := g()
}
}
}
// ----
// DeclarationError 6578: (123-124): Cannot access local Solidity variables from inside an inline assembly function.