File tree Expand file tree Collapse file tree 4 files changed +13
-15
lines changed
Expand file tree Collapse file tree 4 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -3955,6 +3955,15 @@ static void preload_check_windows_restrictions(zend_class_entry *scope) {
39553955}
39563956#endif
39573957
3958+ static inline int preload_update_class_constants (zend_class_entry * ce ) {
3959+ /* This is a separate function to work around what appears to be a bug in GCC
3960+ * maybe-uninitialized analysis. */
3961+ zend_try {
3962+ return zend_update_class_constants (ce );
3963+ } zend_end_try ();
3964+ return FAILURE ;
3965+ }
3966+
39583967static zend_class_entry * preload_load_prop_type (zend_property_info * prop , zend_string * name ) {
39593968 zend_class_entry * ce ;
39603969 if (zend_string_equals_literal_ci (name , "self" )) {
@@ -4000,18 +4009,7 @@ static void preload_ensure_classes_loadable() {
40004009#endif
40014010
40024011 if (!(ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
4003- int result = SUCCESS ;
4004- zend_try {
4005- result = zend_update_class_constants (ce );
4006- } zend_catch {
4007- /* Provide some context for the generated error. */
4008- zend_error_noreturn (E_ERROR ,
4009- "Error generated while resolving initializers of class %s during preloading" ,
4010- ZSTR_VAL (ce -> name ));
4011- } zend_end_try ();
4012- if (result == FAILURE ) {
4013- /* Just present to be safe: We generally always throw some
4014- * other fatal error as part of update_class_constants(). */
4012+ if (preload_update_class_constants (ce ) == FAILURE ) {
40154013 zend_error_noreturn (E_ERROR ,
40164014 "Failed to resolve initializers of class %s during preloading" ,
40174015 ZSTR_VAL (ce -> name ));
Original file line number Diff line number Diff line change @@ -14,4 +14,4 @@ var_dump(class_exists('Foo'));
1414--EXPECTF--
1515Fatal error: Undefined class constant 'self::DOES_NOT_EXIST' in Unknown on line 0
1616
17- Fatal error: Error generated while resolving initializers of class Foo during preloading in Unknown on line 0
17+ Fatal error: Failed to resolve initializers of class Foo during preloading in Unknown on line 0
Original file line number Diff line number Diff line change @@ -15,4 +15,4 @@ var_dump(class_exists('Foo'));
1515--EXPECTF--
1616Fatal error: Undefined constant 'UNDEF' in Unknown on line 0
1717
18- Fatal error: Error generated while resolving initializers of class Foo during preloading in Unknown on line 0
18+ Fatal error: Failed to resolve initializers of class Foo during preloading in Unknown on line 0
Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ Unreachable
1212--EXPECTF--
1313Fatal error: Undefined constant 'UNDEF' in Unknown on line 0
1414
15- Fatal error: Error generated while resolving initializers of class Test during preloading in Unknown on line 0
15+ Fatal error: Failed to resolve initializers of class Test during preloading in Unknown on line 0
You can’t perform that action at this time.
0 commit comments