@@ -570,6 +570,8 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
570
570
zend_ulong hval ;
571
571
zend_string * offset_key ;
572
572
zval * retval ;
573
+ zend_execute_data * execute_data ;
574
+ const zend_op * opline ;
573
575
574
576
if (Z_TYPE_P (dim ) == IS_REFERENCE ) {
575
577
dim = Z_REFVAL_P (dim );
@@ -583,9 +585,15 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
583
585
offset_key = Z_STR_P (dim );
584
586
goto str_index ;
585
587
case IS_UNDEF :
586
- if (!zend_jit_undefined_op_helper_write (ht , EG (current_execute_data )-> opline -> op2 .var )) {
587
- if (EG (exception )) {
588
- undef_result_after_exception ();
588
+ execute_data = EG (current_execute_data );
589
+ opline = EX (opline );
590
+ if (!zend_jit_undefined_op_helper_write (ht , opline -> op2 .var )) {
591
+ if (opline -> result_type & (IS_VAR | IS_TMP_VAR )) {
592
+ if (EG (exception )) {
593
+ ZVAL_UNDEF (EX_VAR (opline -> result .var ));
594
+ } else {
595
+ ZVAL_NULL (EX_VAR (opline -> result .var ));
596
+ }
589
597
}
590
598
return NULL ;
591
599
}
@@ -636,6 +644,8 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_w_helper(zend_array *ht, zval *dim
636
644
zend_ulong hval ;
637
645
zend_string * offset_key ;
638
646
zval * retval ;
647
+ zend_execute_data * execute_data ;
648
+ const zend_op * opline ;
639
649
640
650
if (Z_TYPE_P (dim ) == IS_REFERENCE ) {
641
651
dim = Z_REFVAL_P (dim );
@@ -649,9 +659,15 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_w_helper(zend_array *ht, zval *dim
649
659
offset_key = Z_STR_P (dim );
650
660
goto str_index ;
651
661
case IS_UNDEF :
652
- if (!zend_jit_undefined_op_helper_write (ht , EG (current_execute_data )-> opline -> op2 .var )) {
653
- if (EG (exception )) {
654
- undef_result_after_exception ();
662
+ execute_data = EG (current_execute_data );
663
+ opline = EX (opline );
664
+ if (!zend_jit_undefined_op_helper_write (ht , opline -> op2 .var )) {
665
+ if (opline -> result_type & (IS_VAR | IS_TMP_VAR )) {
666
+ if (EG (exception )) {
667
+ ZVAL_UNDEF (EX_VAR (opline -> result .var ));
668
+ } else {
669
+ ZVAL_NULL (EX_VAR (opline -> result .var ));
670
+ }
655
671
}
656
672
return NULL ;
657
673
}
0 commit comments