Skip to content

Conversation

nielsdos
Copy link
Member

See #17231

@nielsdos nielsdos requested a review from Girgias as a code owner December 27, 2024 15:05
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

MSTM!

/* This can happen by abusing destructors. */
/* TODO: relax this from E_ERROR to an exception */
php_error_docref(NULL, E_ERROR, "GlobIterator lost glob state");
zend_throw_error(NULL, "GlobIterator lost glob state");
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to improve the error message? Also can you add a test to trigger this.

@nielsdos
Copy link
Member Author

@Girgias I just found out that it is actually impossible... The reason being that there's a get_method hook that checks the validity of the object. The reason this crashed in the other PR is because it was on a property instead of on a method, which isn't checked the same way. So I just replaced the code with an assertion and explanation comment.

@nielsdos nielsdos merged commit accf957 into php:master Dec 27, 2024
10 checks passed
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.

2 participants