Skip to content
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

Fixed clone for Message, RepeatedField, and MapField. #8245

Merged
merged 1 commit into from Feb 2, 2021

Conversation

haberman
Copy link
Member

@haberman haberman commented Feb 1, 2021

Also updated the code to use a TypeInfo struct for convenient
passing of type and desc together. This simplified a lot of code
and made this change easier to write.

Fixes #8233

Also updated the code to use a TypeInfo struct for convenient
passing of type and desc together. This simplified a lot of code
and made this change easier to write.
Copy link
Contributor

@gerben-s gerben-s left a comment

Choose a reason for hiding this comment

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

What exactly went wrong and how does this fix it?

@haberman
Copy link
Member Author

haberman commented Feb 2, 2021

@gerben-s see the attached bug: #8233

This PR fixes the problem by implementing the clone_obj handler for Message, RepeatedField, and MapField. clone_obj is a function pointer that we give to the PHP interpreter, PHP will call it when a user writes clone $msg.

@haberman haberman merged commit f3e53a0 into protocolbuffers:master Feb 2, 2021
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.

PHP protobuf extension crashes after cloning a protobuf object
3 participants