-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added fallthrough for == operator with objects for extensions #7973
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?
Changes from 2 commits
348feb7
2fa6155
2be2077
de984eb
c6440fa
8a2b6cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -501,7 +501,11 @@ ZEND_VM_HELPER(zend_is_equal_helper, ANY, ANY, zval *op_1, zval *op_2) | |
if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { | ||
op_2 = ZVAL_UNDEFINED_OP2(); | ||
} | ||
ret = zend_compare(op_1, op_2); | ||
if (Z_TYPE_P(op_1) == IS_OBJECT || Z_TYPE_P(op_2) == IS_OBJECT) { | ||
ret = zend_equals_object(op_1, op_2, ZEND_IS_EQUAL); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe you need a separate zend_equals that is pushed through the entire hierarchy. Otherwise objects nested in arrays will not use the correct handler, for example. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, similar to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah, exactly. |
||
} else { | ||
ret = zend_compare(op_1, op_2); | ||
} | ||
if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { | ||
zval_ptr_dtor_nogc(op_1); | ||
} | ||
|
@@ -581,7 +585,11 @@ ZEND_VM_HELPER(zend_is_not_equal_helper, ANY, ANY, zval *op_1, zval *op_2) | |
if (UNEXPECTED(Z_TYPE_INFO_P(op_2) == IS_UNDEF)) { | ||
op_2 = ZVAL_UNDEFINED_OP2(); | ||
} | ||
ret = zend_compare(op_1, op_2); | ||
if (Z_TYPE_P(op_1) == IS_OBJECT || Z_TYPE_P(op_2) == IS_OBJECT) { | ||
ret = zend_equals_object(op_1, op_2, ZEND_IS_NOT_EQUAL); | ||
} else { | ||
ret = zend_compare(op_1, op_2); | ||
} | ||
if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) { | ||
zval_ptr_dtor_nogc(op_1); | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.