@@ -1163,9 +1163,7 @@ ZEND_VM_C_LABEL(assign_dim_op_array):
11631163 SEPARATE_ARRAY (container );
11641164 ht = Z_ARRVAL_P (container );
11651165ZEND_VM_C_LABEL (assign_dim_op_new_array ):
1166- dim = OP2_TYPE == IS_CONST && opline == & EG (delayed_error_op )[0 ]
1167- ? RT_CONSTANT (EG (opline_before_exception ), opline -> op2 )
1168- : GET_OP2_ZVAL_PTR_UNDEF (BP_VAR_R );
1166+ dim = GET_OP2_ZVAL_PTR_UNDEF (BP_VAR_R );
11691167 if (OP2_TYPE == IS_UNUSED ) {
11701168 var_ptr = zend_hash_next_index_insert (ht , & EG (uninitialized_zval ));
11711169 if (UNEXPECTED (!var_ptr )) {
@@ -1212,9 +1210,7 @@ ZEND_VM_C_LABEL(assign_dim_op_new_array):
12121210 if (EXPECTED (Z_TYPE_P (container ) == IS_OBJECT )) {
12131211 zend_object * obj = Z_OBJ_P (container );
12141212
1215- dim = OP2_TYPE == IS_CONST && opline == & EG (delayed_error_op )[0 ]
1216- ? RT_CONSTANT (EG (opline_before_exception ), opline -> op2 )
1217- : GET_OP2_ZVAL_PTR_UNDEF (BP_VAR_R );
1213+ dim = GET_OP2_ZVAL_PTR_UNDEF (BP_VAR_R );
12181214 if (OP2_TYPE == IS_CONST && Z_EXTRA_P (dim ) == ZEND_EXTRA_VALUE ) {
12191215 dim ++ ;
12201216 }
@@ -1238,9 +1234,7 @@ ZEND_VM_C_LABEL(assign_dim_op_new_array):
12381234 }
12391235 ZEND_VM_C_GOTO (assign_dim_op_new_array );
12401236 } else {
1241- dim = OP2_TYPE == IS_CONST && opline == & EG (delayed_error_op )[0 ]
1242- ? RT_CONSTANT (EG (opline_before_exception ), opline -> op2 )
1243- : GET_OP2_ZVAL_PTR_UNDEF (BP_VAR_R );
1237+ dim = GET_OP2_ZVAL_PTR (BP_VAR_R );
12441238 zend_binary_assign_op_dim_slow (container , dim OPLINE_CC EXECUTE_DATA_CC );
12451239ZEND_VM_C_LABEL (assign_dim_op_ret_null ):
12461240 FREE_OP_DATA ();
@@ -8132,9 +8126,8 @@ ZEND_VM_HANDLER(204, ZEND_HANDLE_DELAYED_ERROR, ANY, ANY)
81328126 EG (delayed_error_op )[1 ] = EG (delayed_error_op )[2 ];
81338127 }
81348128 EG (opline_before_exception ) = next_op ;
8135- EG (current_execute_data )-> opline = EG (delayed_error_op );
81368129
8137- ZEND_VM_SET_NEXT_OPCODE (EG (delayed_error_op ));
8130+ ZEND_VM_SET_NEXT_OPCODE (& EG (delayed_error_op )[ 0 ] );
81388131 } else {
81398132 /* Clear EG(delayed_errors), as more errors may be delayed while we are handling these. */
81408133 HashTable ht ;
@@ -8151,9 +8144,14 @@ ZEND_VM_HANDLER(204, ZEND_HANDLE_DELAYED_ERROR, ANY, ANY)
81518144 zend_hash_destroy (& ht );
81528145
81538146 if (EG (exception )) {
8147+ /* EG(opline_before_exception) is set to &EG(delayed_error_op)[0] by the throwing opline.
8148+ * Reset it to the original opline. */
8149+ EG (opline_before_exception ) = prev_op ;
81548150 HANDLE_EXCEPTION ();
81558151 }
81568152
8153+ EG (opline_before_exception ) = next_op ;
8154+
81578155 ZEND_VM_SET_NEXT_OPCODE (next_op );
81588156 }
81598157
0 commit comments