Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug][move-compiler-v2] *&x gets turned into move x in at least one case #14625

Open
brmataptos opened this issue Sep 13, 2024 · 1 comment
Open
Labels
bug Something isn't working compiler-v2-stable compiler-v2 stale-exempt Prevents issues from being automatically marked and closed as stale

Comments

@brmataptos
Copy link
Contributor

🐛 Bug

Compare test outputs:

  • third_party/move/move-compiler/tests/move_check/translated_ir_tests/move/signer/read_ref_transitive.exp
  • third_party/move/move-compiler-v2/tests/ability-check/v1-signer/read_ref_transitive.exp

V2 seems to accept *&x as valid for a type without copy by turning it into a move x.

Splitting up the test to avoid the other error and generate code shows that is what is happening.

This shouldn't happen. I can't quite think of an attack based on this, but it seems very, very unexpected behavior to move data through an immutable ref.

@rahxephon89
Copy link
Contributor

@wrwg, I asked this question here. Just wondering whether it is a semantic change? cc @brmataptos

@rahxephon89 rahxephon89 self-assigned this Sep 19, 2024
@rahxephon89 rahxephon89 removed their assignment Oct 10, 2024
@brmataptos brmataptos added the stale-exempt Prevents issues from being automatically marked and closed as stale label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler-v2-stable compiler-v2 stale-exempt Prevents issues from being automatically marked and closed as stale
Projects
Status: For Grabs
Development

No branches or pull requests

2 participants