-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Minor refactorings to zend_exceptions() #16684
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good, only some remark about comments
Zend/zend_exceptions.c
Outdated
@@ -539,16 +539,18 @@ static void _build_trace_string(smart_str *str, HashTable *ht, uint32_t num) /* | |||
|
|||
file = zend_hash_find_known_hash(ht, ZSTR_KNOWN(ZEND_STR_FILE)); | |||
if (file) { | |||
if (Z_TYPE_P(file) != IS_STRING) { | |||
if (UNEXPECTED(Z_TYPE_P(file) != IS_STRING)) { | |||
/* This is a typed property and can only happen if modified via ArrayObject */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not true, see bug63762.phpt in Zend
Zend/zend_exceptions.c
Outdated
line = Z_LVAL_P(tmp); | ||
} else { | ||
/* This is a typed property and can only happen if modified via ArrayObject */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely not true as well due to similar reasons as bug63762.phpt in Zend
Zend/zend_exceptions.c
Outdated
@@ -583,21 +585,22 @@ static void _build_trace_string(smart_str *str, HashTable *ht, uint32_t num) /* | |||
ZSTR_LEN(str->s) -= 2; /* remove last ', ' */ | |||
} | |||
} else { | |||
/* The trace property is typed and private */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check with bug63762.phpt in Zend
I was planning on removing a bunch of
zval_get_long()
andzval_get_string()
calls to properties as those are typed properties, however not sure it is wise to remove them asArrayObject
can in theory mess them up.