Fix shadowing error for inline assembly.

This commit is contained in:
chriseth
2021-08-17 12:12:56 +02:00
parent 838514a718
commit aeb2438eab
25 changed files with 67 additions and 56 deletions
@@ -1,12 +0,0 @@
contract C {
function f() public returns (uint x) {
assembly {
function g() -> f { f := 2 }
x := g()
}
}
}
// ====
// compileViaYul: also
// ----
// f() -> 2
@@ -7,11 +7,11 @@ contract C {
uint256 off1;
uint256 off2;
assembly {
function f() -> o1 {
function g() -> o1 {
sstore(z.slot, 7)
o1 := y.offset
}
off2 := f()
off2 := g()
}
assert(off2 == 2);
return true;
@@ -1,5 +1,5 @@
contract C {
function f() public pure returns (uint w) {
function g() public pure returns (uint w) {
assembly {
function f() -> t {
t := 2
@@ -14,4 +14,4 @@ contract C {
// compileToEwasm: also
// compileViaYul: also
// ----
// f() -> 2
// g() -> 2