Skip to content

Conversation

@chriseth
Copy link
Contributor

@chriseth chriseth commented Aug 4, 2021

Fixes #11734

@ekpyron
Copy link
Collaborator

ekpyron commented Aug 10, 2021

I haven't thought the change through entirely, but what happens for

contract C {
function f() public {
    uint x; 
    assembly {
        function g() -> x {
            x := 42
        }
        x := g()
    }
}
}

?
Generally, a few test cases would be nice.

@chriseth
Copy link
Contributor Author

This is weird, I thought I had tests in this PR...

@chriseth
Copy link
Contributor Author

@chriseth chriseth force-pushed the shadowing_inlineasm_fix_yul_codegen branch from bc06e1a to 67a5cd8 Compare August 11, 2021 12:51
@chriseth
Copy link
Contributor Author

Added two tests. Changelog not necessary since it only fixes an issue with the sol yul code gen.

@chriseth chriseth force-pushed the shadowing_inlineasm_fix_yul_codegen branch from 67a5cd8 to a4c94a1 Compare August 11, 2021 16:18
}
}
// ----
// DeclarationError 6578: (123-124): Cannot access local Solidity variables from inside an inline assembly function.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's of course a bit weird... but if we make the -> x a proper shadowing error later on, I guess it's fine for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, this is not a new error.

@chriseth
Copy link
Contributor Author

Removed "fixes #11380 (maybe)" because I think it does not.

@chriseth chriseth merged commit ccdc11e into develop Aug 12, 2021
@chriseth chriseth deleted the shadowing_inlineasm_fix_yul_codegen branch August 12, 2021 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sol->Yul] Unimplemented feature error

3 participants