Skip to content

Commit cc1be75

Browse files
make sure we lift exceptions up the call stack
1 parent 711d831 commit cc1be75

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/reflection/php_reflection.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5156,7 +5156,7 @@ ZEND_METHOD(ReflectionClass, newInstanceFromData)
51565156
}
51575157

51585158
if (UNEXPECTED(object_init_ex(return_value, ce) != SUCCESS)) {
5159-
return;
5159+
RETURN_THROWS();
51605160
}
51615161

51625162
ZEND_HASH_FOREACH_STR_KEY_VAL(data, key, val) {
@@ -5181,9 +5181,11 @@ ZEND_METHOD(ReflectionClass, newInstanceFromData)
51815181

51825182
if (EG(exception)) {
51835183
zend_object_store_ctor_failed(Z_OBJ_P(return_value));
5184+
RETURN_THROWS();
51845185
}
51855186
} else if (argc) {
51865187
zend_throw_exception_ex(reflection_exception_ptr, 0, "Class %s does not have a constructor, so you cannot pass any constructor arguments", ZSTR_VAL(ce->name));
5188+
RETURN_THROWS();
51875189
}
51885190
}
51895191
/* }}} */

0 commit comments

Comments
 (0)