@@ -2464,8 +2464,11 @@ function run_test(string $php, $file, array $env): string
2464
2464
$ cmd = $ valgrind ->wrapCommand ($ cmd , $ memcheck_filename , strpos ($ test_file , "pcre " ) !== false );
2465
2465
}
2466
2466
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
+ }
2469
2472
}
2470
2473
2471
2474
if ($ DETAILED ) {
@@ -2664,7 +2667,7 @@ function run_test(string $php, $file, array $env): string
2664
2667
if ($ test ->hasSection ('XFAIL ' )) {
2665
2668
$ warn = true ;
2666
2669
$ info = " (warn: XFAIL section but test passes) " ;
2667
- } elseif ($ test ->hasSection ('XLEAK ' ) && ! isset ( $ env [ ' SKIP_ASAN ' ]) ) {
2670
+ } elseif ($ test ->hasSection ('XLEAK ' ) && $ valgrind ) {
2668
2671
// XLEAK with ASAN completely disables LSAN so the test is expected to pass
2669
2672
$ warn = true ;
2670
2673
$ info = " (warn: XLEAK section but test passes) " ;
@@ -2702,7 +2705,7 @@ function run_test(string $php, $file, array $env): string
2702
2705
if ($ test ->hasSection ('XFAIL ' )) {
2703
2706
$ restype [] = 'XFAIL ' ;
2704
2707
$ info = ' XFAIL REASON: ' . rtrim ($ test ->getSection ('XFAIL ' ));
2705
- } elseif ($ test ->hasSection ('XLEAK ' ) && ! isset ( $ env [ ' SKIP_ASAN ' ]) ) {
2708
+ } elseif ($ test ->hasSection ('XLEAK ' ) && $ valgrind ) {
2706
2709
// XLEAK with ASAN completely disables LSAN so the test is expected to pass
2707
2710
$ restype [] = 'XLEAK ' ;
2708
2711
$ info = ' XLEAK REASON: ' . rtrim ($ test ->getSection ('XLEAK ' ));
0 commit comments