@@ -2464,8 +2464,11 @@ function run_test(string $php, $file, array $env): string
24642464 $ cmd = $ valgrind ->wrapCommand ($ cmd , $ memcheck_filename , strpos ($ test_file , "pcre " ) !== false );
24652465 }
24662466
2467- if ($ test ->hasSection ('XLEAK ' ) && isset ($ env ['SKIP_ASAN ' ])) {
2468- $ env ['LSAN_OPTIONS ' ] = 'detect_leaks=0 ' ;
2467+ if ($ test ->hasSection ('XLEAK ' )) {
2468+ $ env ['ZEND_ALLOC_PRINT_LEAKS ' ] = '0 ' ;
2469+ if (isset ($ env ['SKIP_ASAN ' ])) {
2470+ $ env ['LSAN_OPTIONS ' ] = 'detect_leaks=0 ' ;
2471+ }
24692472 }
24702473
24712474 if ($ DETAILED ) {
@@ -2664,7 +2667,7 @@ function run_test(string $php, $file, array $env): string
26642667 if ($ test ->hasSection ('XFAIL ' )) {
26652668 $ warn = true ;
26662669 $ info = " (warn: XFAIL section but test passes) " ;
2667- } elseif ($ test ->hasSection ('XLEAK ' ) && ! isset ( $ env [ ' SKIP_ASAN ' ]) ) {
2670+ } elseif ($ test ->hasSection ('XLEAK ' ) && $ valgrind ) {
26682671 // XLEAK with ASAN completely disables LSAN so the test is expected to pass
26692672 $ warn = true ;
26702673 $ info = " (warn: XLEAK section but test passes) " ;
@@ -2702,7 +2705,7 @@ function run_test(string $php, $file, array $env): string
27022705 if ($ test ->hasSection ('XFAIL ' )) {
27032706 $ restype [] = 'XFAIL ' ;
27042707 $ info = ' XFAIL REASON: ' . rtrim ($ test ->getSection ('XFAIL ' ));
2705- } elseif ($ test ->hasSection ('XLEAK ' ) && ! isset ( $ env [ ' SKIP_ASAN ' ]) ) {
2708+ } elseif ($ test ->hasSection ('XLEAK ' ) && $ valgrind ) {
27062709 // XLEAK with ASAN completely disables LSAN so the test is expected to pass
27072710 $ restype [] = 'XLEAK ' ;
27082711 $ info = ' XLEAK REASON: ' . rtrim ($ test ->getSection ('XLEAK ' ));
0 commit comments