aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
6.11k stars 3.62k forks source link

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

Open brmataptos opened 2 weeks ago

brmataptos commented 2 weeks ago

🐛 Bug

Compare test outputs:

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 commented 1 week ago

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