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][compiler-v2] Locations available in stackless bytecode are incorrect when wildcards are involved #12843

Open
vineethk opened this issue Apr 10, 2024 · 0 comments
Labels
bug Something isn't working compiler-v2 stale-exempt Prevents issues from being automatically marked and closed as stale

Comments

@vineethk
Copy link
Contributor

🐛 Bug

This bug pertains to compiler v2 (and the bug description should be read with that context in mind).

When we have move code involving wildcards, like let _ = x;, the AST to stackless bytecode translation does not pass on location information correctly (in particular, it is different from how location information is passed on for say let _1 = x;).

Because of this, when there are errors involved in such code, that stackless-bytecode-based checkers can report, the location provided in the error messages point to incorrect part of the code.

Consider the following example (taken from third_party/move/move-compiler-v2/tests/bytecode-generator/wildcard2.move):

module 0xc0ffee::m {
    public fun baz() {
        let x: u64;
        let _ = x;
    }
}

Compiler v2 reports the following error (note where we point to):

error: use of unassigned local `x`
  ┌─ tests/bytecode-generator/wildcard2.move:4:13
  │
4 │         let _ = x;
  │             ^

Another similar example can be seen in third_party/move/move-compiler-v2/tests/bytecode-generator/wildcard7.exp after #12818 lands.

@vineethk vineethk added bug Something isn't working compiler-v2 labels Apr 10, 2024
@sausagee sausagee added the stale-exempt Prevents issues from being automatically marked and closed as stale label Apr 15, 2024
@sausagee sausagee moved this from 🆕 New to 📋 Backlog in Move Language and Runtime Apr 24, 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 stale-exempt Prevents issues from being automatically marked and closed as stale
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants