File tree Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -3870,6 +3870,15 @@ static void preload_check_windows_restrictions(zend_class_entry *scope) {
3870
3870
}
3871
3871
#endif
3872
3872
3873
+ static inline int preload_update_class_constants (zend_class_entry * ce ) {
3874
+ /* This is a separate function to work around what appears to be a bug in GCC
3875
+ * maybe-uninitialized analysis. */
3876
+ zend_try {
3877
+ return zend_update_class_constants (ce );
3878
+ } zend_end_try ();
3879
+ return FAILURE ;
3880
+ }
3881
+
3873
3882
static zend_class_entry * preload_load_prop_type (zend_property_info * prop , zend_string * name ) {
3874
3883
zend_class_entry * ce ;
3875
3884
if (zend_string_equals_literal_ci (name , "self" )) {
@@ -3915,18 +3924,7 @@ static void preload_ensure_classes_loadable() {
3915
3924
#endif
3916
3925
3917
3926
if (!(ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
3918
- int result = SUCCESS ;
3919
- zend_try {
3920
- result = zend_update_class_constants (ce );
3921
- } zend_catch {
3922
- /* Provide some context for the generated error. */
3923
- zend_error_noreturn (E_ERROR ,
3924
- "Error generated while resolving initializers of class %s during preloading" ,
3925
- ZSTR_VAL (ce -> name ));
3926
- } zend_end_try ();
3927
- if (result == FAILURE ) {
3928
- /* Just present to be safe: We generally always throw some
3929
- * other fatal error as part of update_class_constants(). */
3927
+ if (preload_update_class_constants (ce ) == FAILURE ) {
3930
3928
zend_error_noreturn (E_ERROR ,
3931
3929
"Failed to resolve initializers of class %s during preloading" ,
3932
3930
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 @@ -14,4 +14,4 @@ Warning: Use of undefined constant UNDEF - assumed 'UNDEF' (this will throw an E
14
14
15
15
Fatal error: Class 'Foo' not found in Unknown on line 0
16
16
17
- Fatal error: Error generated while resolving initializers of class Test during preloading in Unknown on line 0
17
+ 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