@@ -321,7 +321,7 @@ static zend_always_inline bool xdebug_string_equals_cstr(const zend_string *s1,
321321# define xdebug_string_equals_literal zend_string_equals_literal
322322#endif
323323
324- static int xdebug_find_jumps (zend_op_array * opa , unsigned int position , size_t * jump_count , int * jumps )
324+ static int xdebug_find_jumps (zend_op_array * opa , unsigned int position , size_t * jump_count , int * jumps , bool * soft_fail_jumps )
325325{
326326#if ZEND_USE_ABS_JMP_ADDR
327327 zend_op * base_address = & (opa -> opcodes [0 ]);
@@ -361,6 +361,7 @@ static int xdebug_find_jumps(zend_op_array *opa, unsigned int position, size_t *
361361 } else if (opcode .opcode == ZEND_FE_RESET_R || opcode .opcode == ZEND_FE_RESET_RW ) {
362362 jumps [0 ] = position + 1 ;
363363 jumps [1 ] = XDEBUG_ZNODE_JMP_LINE (opcode .op2 , position , base_address );
364+ soft_fail_jumps [1 ] = true;
364365 * jump_count = 2 ;
365366 return 1 ;
366367
@@ -512,10 +513,14 @@ static void xdebug_analysis_branch(zend_op_array *opa, unsigned int position, xd
512513 while (position < opa -> last ) {
513514 size_t jump_count = 0 ;
514515 int jumps [XDEBUG_BRANCH_MAX_OUTS ];
516+ bool soft_fail_jumps [XDEBUG_BRANCH_MAX_OUTS ];
515517 size_t i ;
516518
519+ /* Clean out soft_fail_jumps */
520+ memset (soft_fail_jumps , 0 , sizeof (soft_fail_jumps ));
521+
517522 /* See if we have a jump instruction */
518- if (xdebug_find_jumps (opa , position , & jump_count , jumps )) {
523+ if (xdebug_find_jumps (opa , position , & jump_count , jumps , soft_fail_jumps )) {
519524 /* Record the highest jump if we have branch information*/
520525 if (branch_info && jump_count > branch_info -> highest_out ) {
521526 branch_info -> highest_out = jump_count ;
@@ -524,7 +529,7 @@ static void xdebug_analysis_branch(zend_op_array *opa, unsigned int position, xd
524529 for (i = 0 ; i < jump_count ; i ++ ) {
525530 if (jumps [i ] == XDEBUG_JMP_EXIT || jumps [i ] != XDEBUG_JMP_NOT_SET ) {
526531 if (branch_info ) {
527- xdebug_branch_info_update (branch_info , position , opa -> opcodes [position ].lineno , i , jumps [i ]);
532+ xdebug_branch_info_update (branch_info , position , opa -> opcodes [position ].lineno , i , jumps [i ], soft_fail_jumps [ i ] );
528533 }
529534 if (jumps [i ] != XDEBUG_JMP_EXIT ) {
530535 xdebug_analysis_branch (opa , jumps [i ], set , branch_info );
0 commit comments