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

Analyzer doesn't check unary minus operation on unsigned type #651

Closed
Y-Nak opened this issue Feb 1, 2022 · 2 comments · Fixed by #713
Closed

Analyzer doesn't check unary minus operation on unsigned type #651

Y-Nak opened this issue Feb 1, 2022 · 2 comments · Fixed by #713
Assignees
Labels
comp: analyzer Everything that involves the analyzer pass good first issue Good for newcomers type: security

Comments

@Y-Nak
Copy link
Member

Y-Nak commented Feb 1, 2022

What is wrong?

contract Foo:
    pub fn bar(self) -> u32:
        let unsigned: u32 = 1
        return -unsigned

It's better to reject the code above for safety.

How can it be fixed

Tweaking this lines would fix the issue.

@Y-Nak Y-Nak added good first issue Good for newcomers type: security comp: analyzer Everything that involves the analyzer pass labels Feb 1, 2022
@hmrtn
Copy link

hmrtn commented Feb 11, 2022

I'd like to tackle this issue.

@Y-Nak
Copy link
Member Author

Y-Nak commented Feb 11, 2022

Thanks @hmrtn! Please feel free to ask me in Discord or here if you have any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: analyzer Everything that involves the analyzer pass good first issue Good for newcomers type: security
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants