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.19k stars 3.66k forks source link

[Bug][move-compiler-v2] Compiler V2 constant folding folds SHR width == type size #14631

Open brmataptos opened 2 months ago

brmataptos commented 2 months ago

🐛 Bug

Compiler V2 constant-folds (0u8 >> 8) to 0, while V1 leaves this operation in to abort at runtime.

The manual says the code "may abort" if the shift width is the same as the type size, so it's technically allowed (and thus not Urgent), but this behavior differs from V1, so would be better corrected.

Case 1:

github-actions[bot] commented 4 weeks ago

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.