-
Notifications
You must be signed in to change notification settings - Fork 8k
ext/zip: further micro optimisations. #20362
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
base: master
Are you sure you want to change the base?
Conversation
devnexen
commented
Nov 2, 2025
- forgotten remaining libzip < 1.0.0 code path.
- earlier return on invalid inputs from some ZipArchive methods.
- forgotten remaining libzip < 1.0.0 code path. - earlier return on invalid inputs from some ZipArchive methods.
…dex(). and throw exception for these
TODO: fix mem leaks on encryption methods.
e06204f to
a951792
Compare
| if (index < 0) { | ||
| RETURN_FALSE; | ||
| } |
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.
I guess it might make sense to make those sorts of conditions a warning/value error in the future?
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.
Yes I kept "api compatible" for now on purpose.
ext/zip/php_zip.c
Outdated
| if (method < 0) { | ||
| RETURN_FALSE; | ||
| } | ||
| RETVAL_BOOL(zip_compression_method_supported((zip_int32_t)method, enc)); |
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.
Isn't this a problem if method is larger than a 32bit int but still positive on x64?
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.
good point