Skip to content

Conversation

nielsdos
Copy link
Member

Here's a subtle bug.
The condition UNEXPECTED(Z_TYPE_P(key)) == IS_REFERENCE always returned false, because UNEXPECTED(expression) always returns 0 or 1. Move the parens so the comparison is executed properly.

Note: I found this using a static analyser, and manually verified that the report is in fact a real bug. After fixing this the analyser no longer complains.

The condition `UNEXPECTED(Z_TYPE_P(key)) == IS_REFERENCE` always
returned false, because `UNEXPECTED(expression)` always returns 0 or 1.
Move the parens so the comparison is executed properly.
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

Oh, very good finding! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants