Fix ReflectionClass::getConstants() stub

If `zval_update_constant_ex()` fails, an exception has already been
thrown, so we clarify that in the implementation as well.

Closes GH-6557.
This commit is contained in:
Christoph M. Becker 2020-12-31 19:36:27 +01:00
parent 2e854791af
commit 82f9e004da
3 changed files with 3 additions and 4 deletions

View file

@ -4446,8 +4446,7 @@ ZEND_METHOD(ReflectionClass, getConstants)
array_init(return_value);
ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->constants_table, key, constant) {
if (UNEXPECTED(zval_update_constant_ex(&constant->value, ce) != SUCCESS)) {
zend_array_destroy(Z_ARRVAL_P(return_value));
RETURN_NULL();
RETURN_THROWS();
}
if (Z_ACCESS_FLAGS(constant->value) & filter) {