Skip to content

Fix OSS-Fuzz #69765 #14716

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

Closed
wants to merge 2 commits into from
Closed

Fix OSS-Fuzz #69765 #14716

wants to merge 2 commits into from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Jun 29, 2024

You cannot return or yield a reference to a nullsafe chain. This was
checked already in zend_compile_return but not yet in
zend_compile_yield.

First commit fixes the bug, second commit factors out the common code.

nielsdos added 2 commits June 29, 2024 14:17
You cannot return or yield a reference to a nullsafe chain. This was
checked already in zend_compile_return but not yet in
zend_compile_yield.
@jorgsowa
Copy link
Contributor

The current message Cannot take reference is unfortunate. You described the limitation much better in the PR description by You cannot return or yield a reference to a nullsafe chain..

@nielsdos
Copy link
Member Author

nielsdos commented Jun 29, 2024

I'm fine with making the message specialised but I'll wait first for Ilija and/or Dmitry to comment.
EDIT: and changing messages for existing compile errors seems like master-only material.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

You cannot return or yield a reference to a nullsafe chain.

The error occurs before the return, when trying to acquire the reference. ?-> can return the temporary value null, which cannot be turned into a reference, as it would have no effect.

@nielsdos
Copy link
Member Author

The error occurs before the return, when trying to acquire the reference. ?-> can return the temporary value null, which cannot be turned into a reference, as it would have no effect.

Right ofc, this description is indeed more accurate.

@nielsdos nielsdos closed this in d568337 Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants