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

Missing parentheses in cast #1

Open
Kripth opened this issue Mar 6, 2024 · 2 comments
Open

Missing parentheses in cast #1

Kripth opened this issue Mar 6, 2024 · 2 comments

Comments

@Kripth
Copy link

Kripth commented Mar 6, 2024

When decompiling a cast it seems that the outer parentheses are optimised away.

Example:

fun test(a: u64): u256 {
    (a as u256)
}

// decompiles to
fun test(arg0: u64) : u256 {
    arg0 as u256
}

When a cast is not the outer operator it is decompiled correctly:

fun test(a: u64): u256 {
    ((a as u128) as u256)
}

// decompiles to
fun test(arg0: u64) : u256 {
    (arg0 as u128) as u256
}
@aquynh
Copy link
Collaborator

aquynh commented Mar 7, 2024

thanks for the bug report. do you want to make a PR to fix this?

@aquynh
Copy link
Collaborator

aquynh commented Mar 7, 2024

fixed in the "dev" branch now, can you confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants