File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ oss-fuzz #57821: Unevaluated rhs of class constant fetch in constant expression
3
+ --FILE--
4
+ <?php
5
+ class Foo {
6
+ const Foo = 'foo ' ;
7
+ }
8
+ const C = Foo::{Foo::class};
9
+ var_dump (C);
10
+ ?>
11
+ --EXPECT--
12
+ string(3) "foo"
Original file line number Diff line number Diff line change @@ -10761,14 +10761,14 @@ static void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
10761
10761
zend_ast * name_ast ;
10762
10762
zend_string * resolved_name ;
10763
10763
10764
+ zend_eval_const_expr (& ast -> child [0 ]);
10765
+ zend_eval_const_expr (& ast -> child [1 ]);
10766
+
10764
10767
if (UNEXPECTED (ast -> child [1 ]-> kind != ZEND_AST_ZVAL
10765
10768
|| Z_TYPE_P (zend_ast_get_zval (ast -> child [1 ])) != IS_STRING )) {
10766
10769
return ;
10767
10770
}
10768
10771
10769
- zend_eval_const_expr (& ast -> child [0 ]);
10770
- zend_eval_const_expr (& ast -> child [1 ]);
10771
-
10772
10772
class_ast = ast -> child [0 ];
10773
10773
name_ast = ast -> child [1 ];
10774
10774
You can’t perform that action at this time.
0 commit comments