mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix shadowing error for inline assembly.
This commit is contained in:
-12
@@ -1,12 +0,0 @@
|
||||
contract C {
|
||||
function f() public returns (uint x) {
|
||||
assembly {
|
||||
function g() -> f { f := 2 }
|
||||
x := g()
|
||||
}
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 2
|
||||
+2
-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
|
||||
|
||||
Reference in New Issue
Block a user