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) {
3955
3955
}
3956
3956
#endif
3957
3957
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
+
3958
3967
static zend_class_entry * preload_load_prop_type (zend_property_info * prop , zend_string * name ) {
3959
3968
zend_class_entry * ce ;
3960
3969
if (zend_string_equals_literal_ci (name , "self" )) {
@@ -4000,18 +4009,7 @@ static void preload_ensure_classes_loadable() {
4000
4009
#endif
4001
4010
4002
4011
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 ) {
4015
4013
zend_error_noreturn (E_ERROR ,
4016
4014
"Failed to resolve initializers of class %s during preloading" ,
4017
4015
ZSTR_VAL (ce -> name ));
Original file line number Diff line number Diff line change @@ -14,4 +14,4 @@ var_dump(class_exists('Foo'));
14
14
--EXPECTF--
15
15
Fatal error: Undefined class constant 'self::DOES_NOT_EXIST' in Unknown on line 0
16
16
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'));
15
15
--EXPECTF--
16
16
Fatal error: Undefined constant 'UNDEF' in Unknown on line 0
17
17
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
12
12
--EXPECTF--
13
13
Fatal error: Undefined constant 'UNDEF' in Unknown on line 0
14
14
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