Skip to content

Implement ASR pass that checks every signed and unsigned integer arithmetic and casts #2183

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

Open
certik opened this issue Jul 18, 2023 · 1 comment

Comments

@certik
Copy link
Contributor

certik commented Jul 18, 2023

This pass will only be run in Debug mode, but not in Release mode. The pass replaces IntegerBinOp with a function call to ASR functions (that the pass generates) such as add_checked(u32, u32) -> u32 which internally checks that the operation fits into u32, otherwise gives a runtime error.

@Shaikh-Ubaid
Copy link
Collaborator

Related #2176 (comment).

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