1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix use of magic const within const expr cast (GH-18338)

Fixes OSS-Fuzz #410939023
This commit is contained in:
Ilija Tovilo
2025-04-16 20:00:40 +02:00
committed by GitHub
parent 66d5cf8d2d
commit 87499e44f2
2 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
--TEST--
OSS-Fuzz #410939023: Use of magic const within const expr cast
--FILE--
<?php
const C = (string)__METHOD__;
var_dump(C);
?>
--EXPECT--
string(0) ""

View File

@@ -12127,6 +12127,9 @@ static void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
zend_eval_const_expr(&ast->child[0]);
zend_eval_const_expr(&ast->child[1]);
return;
case ZEND_AST_CAST:
zend_eval_const_expr(&ast->child[0]);
return;
default:
return;
}