-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove ZEND_DVAL_TO_LVAL_CAST_OK #9215
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
Conversation
Given that casting an out of range float to an integer is undefined behavior, I think you're right. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be back-ported to PHP 8.0?
I'd say, yes. |
@cmb69 |
We need to keep |
As far as I can see, this operation should always use the _slow method, and the results seem to be wrong when ZEND_DVAL_TO_LVAL_CAST_OK is enabled.
d2bb76f
to
c162a73
Compare
c162a73
to
c77a8c3
Compare
@cmb69 @iluuu1994 (I am newbie to this process, so I will |
@zeriyoshi, yes, that makes sense. But don't forget to still merge upwards (first into PHP 8.1, and then into "master"). |
As far as I can see, this operation should always use the slow (right) method, and the results seem to be wrong when
ZEND_DVAL_TO_LVAL_CAST_OK
is enabled.I see, this macro seems to be always disabled in Linux / gcc and macOS 10.15 / clang (13.0.0) environments. (If clang is updated, the autoconf check succeeds and it is enabled. The test always fails because it does not work as expected)
Are there cases where this macro is correctly enabled?
Blocker: #9087