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

"Verification failed" compiler error for u256/u64 multiplication #5453

Closed
dmihal opened this issue Jan 11, 2024 · 1 comment · Fixed by #5489
Closed

"Verification failed" compiler error for u256/u64 multiplication #5453

dmihal opened this issue Jan 11, 2024 · 1 comment · Fixed by #5489
Assignees
Labels
bug Something isn't working compiler: ir IRgen and sway-ir including optimization passes

Comments

@dmihal
Copy link
Contributor

dmihal commented Jan 11, 2024

A project of mine is emitting the following error:

error: Internal compiler error: Verification failed: Type mismatch found for call to 'multiply_207': u64 is not a u256.
Please file an issue on the repository and include the code that triggered this error.

The compiler should provide a standard error displaying the line number and source code.

@dmihal
Copy link
Contributor Author

dmihal commented Jan 11, 2024

I've been able to create some simple reproductions:

library;

#[test]
fn test_mul() {
    let a = 1;
    let b = 0x2u256;
    log(b * a);
}

Gives the error:

error: Internal compiler error: Verification failed: Store value and pointer type mismatch.
Please file an issue on the repository and include the code that triggered this error.

Also applies to lt/gt

library;

#[test]
fn test_mul() {
    let a = 1;
    let b = 0x2u256;
    log(b > a);
}

@tritao tritao added bug Something isn't working compiler: ir IRgen and sway-ir including optimization passes labels Jan 12, 2024
vaivaswatha added a commit that referenced this issue Jan 17, 2024
…5489)

Fixes #5453,
Fixes #5454

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
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: ir IRgen and sway-ir including optimization passes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants