File tree 3 files changed +35
-1
lines changed
3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 3
3
?? ??? ????, PHP 7.4.7
4
4
5
5
- Core:
6
+ . Fixed bug #97599 (coredump in set_error_handler). (Laruence)
6
7
. Fixed bug #79566 (Private SHM is not private on Windows). (cmb)
7
8
. Fixed bug #79489 (.user.ini does not inherit). (cmb)
8
9
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #79599 (coredump in set_error_handler)
3
+ --FILE--
4
+ <?php
5
+ set_error_handler (function ($ code , $ message ){
6
+ throw new \Exception ($ message );
7
+ });
8
+ function test1 (){
9
+ $ a [] = $ b ;
10
+ }
11
+ function test2 (){
12
+ $ a [$ c ] = $ b ;
13
+ }
14
+ try {
15
+ test1 ();
16
+ }catch (\Exception $ e ){
17
+ var_dump ($ e ->getMessage ());
18
+ }
19
+ try {
20
+ test2 ();
21
+ }catch (\Exception $ e ){
22
+ var_dump ($ e ->getMessage ());
23
+ }
24
+ ?>
25
+ --EXPECT--
26
+ string(21) "Undefined variable: b"
27
+ string(21) "Undefined variable: c"
Original file line number Diff line number Diff line change @@ -1248,6 +1248,10 @@ ZEND_API zval *zend_get_configuration_directive(zend_string *name) /* {{{ */
1248
1248
} \
1249
1249
} while (0)
1250
1250
1251
+ static void arg_copy_ctor (zval * zv ) {
1252
+ zval_copy_ctor (zv );
1253
+ }
1254
+
1251
1255
static ZEND_COLD void zend_error_va_list (
1252
1256
int type , const char * error_filename , uint32_t error_lineno ,
1253
1257
const char * format , va_list args )
@@ -1341,7 +1345,9 @@ static ZEND_COLD void zend_error_va_list(
1341
1345
if (!symbol_table ) {
1342
1346
ZVAL_NULL (& params [4 ]);
1343
1347
} else {
1344
- ZVAL_ARR (& params [4 ], zend_array_dup (symbol_table ));
1348
+ array_init (& params [4 ]);
1349
+ /* always try to do noninvasive duplication */
1350
+ zend_hash_copy (Z_ARRVAL (params [4 ]), symbol_table , arg_copy_ctor );
1345
1351
}
1346
1352
1347
1353
ZVAL_COPY_VALUE (& orig_user_error_handler , & EG (user_error_handler ));
You can’t perform that action at this time.
0 commit comments