You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following snippet results in yul that is rejected by solc:
data Wrapper = Wrapper(word);
contract C {
function main() -> word {
return foo(Wrapper(1));
}
function foo(w:Wrapper) -> word {
let result : word;
match w {
| Wrapper(ptr) =>
//let ptr2 : word = ptr;
assembly { result := calldataload(ptr) }
}
return result;
}
}
Error: Identifier "ptr" not found.
--> bug.yul:7:30:
|
7 | result := calldataload(ptr)
| ^^^
uncommenting the let ptr2 ... line and using ptr2 as the arg to calldataload fixes the error.