-
Notifications
You must be signed in to change notification settings - Fork 668
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
Constexpr evaluator underflow / overflow handling for + and - #5921
Comments
Hey @BafS, can you reproduce the issue on https://psalm.dev ? |
I found these snippets: https://psalm.dev/r/b5c187cf0c<?php
const MASK = (1 << 63) - (1 << 20);
|
The code handling psalm/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/NonDivArithmeticOpAnalyzer.php Lines 311 to 340 in cf6a4e7
|
Pow is not completely fixed btw, you need to check PHP_INT_MAX but PHP_INT_MIN too. |
I found these snippets: https://psalm.dev/r/e4949e1737<?php
2 ** 63;
|
I have a type error bug (similar to #5505) when using binary shifts
Psalm version: v4.7.3
Error
psalm.xml
bug-psalm.php
The text was updated successfully, but these errors were encountered: