]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 9 Jul 2020 09:13:50 +0000 (11:13 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 9 Jul 2020 09:18:03 +0000 (11:18 +0200)
* PHP-7.4:
  Fix bug #79599 in a different way
  Revert "Fixed bug #97599 (coredump in set_error_handler)"

1  2 
Zend/tests/bug79599.phpt
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 0000000000000000000000000000000000000000,d3ae8edacc00f791f4258889617bc71978fcad42..b333f153a8cb18125a770c9de246710fa59f3d71
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,27 +1,27 @@@
 -string(21) "Undefined variable: b"
 -string(21) "Undefined variable: b"
+ --TEST--
+ Bug #79599 (coredump in set_error_handler)
+ --FILE--
+ <?php
+ set_error_handler(function($code, $message){
+       throw new \Exception($message);
+ });
+ function test1(){
+       $a[] = $b;
+ }
+ function test2(){
+       $a[$c] = $b;
+ }
+ try{
+       test1();
+ }catch(\Exception $e){
+       var_dump($e->getMessage());
+ }
+ try{
+       test2();
+ }catch(\Exception $e){
+       var_dump($e->getMessage());
+ }
+ ?>
+ --EXPECT--
++string(21) "Undefined variable $b"
++string(21) "Undefined variable $c"
index 1365958e5a475ee3dead565113d1d2d43950ce04,64edccbdf773496adee499a673f2e6a55a2e7b68..c89173687036df12070af559c5ebc6e6bcaea373
@@@ -2599,10 -2700,12 +2598,10 @@@ ZEND_VM_C_LABEL(try_assign_dim_array)
                                ZEND_VM_C_GOTO(try_assign_dim_array);
                        }
                } else {
 -                      if (OP1_TYPE != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
 -                              zend_use_scalar_as_array();
 -                      }
 +                      zend_use_scalar_as_array();
                        dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
  ZEND_VM_C_LABEL(assign_dim_error):
-                       FREE_UNFETCHED_OP_DATA();
+                       FREE_OP_DATA();
                        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                                ZVAL_NULL(EX_VAR(opline->result.var));
                        }
Simple merge