Skip to content

[libc++abi] Fix alternate deletions in exhaustion tests - #193130

Merged
ldionne merged 1 commit into
llvm:mainfrom
dwrank:fix-issue-192773
Jun 26, 2026
Merged

[libc++abi] Fix alternate deletions in exhaustion tests#193130
ldionne merged 1 commit into
llvm:mainfrom
dwrank:fix-issue-192773

Conversation

@dwrank

@dwrank dwrank commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #192773

Verified the test passes.

@dwrank
dwrank requested a review from a team as a code owner April 21, 2026 02:26
@llvmbot llvmbot added the libc++abi libc++abi C++ Runtime Library. Not libc++. label Apr 21, 2026
@llvmbot

llvmbot commented Apr 21, 2026

Copy link
Copy Markdown
Member

@llvm/pr-subscribers-libcxxabi

Author: Daniel Rank (dwrank)

Changes

Fixes #192773

Verified the test passes.


Full diff: https://github.com/llvm/llvm-project/pull/193130.diff

1 Files Affected:

  • (modified) libcxxabi/test/test_fallback_malloc.pass.cpp (+3-3)
diff --git a/libcxxabi/test/test_fallback_malloc.pass.cpp b/libcxxabi/test/test_fallback_malloc.pass.cpp
index 379fe57295cba..ea52fd1227724 100644
--- a/libcxxabi/test/test_fallback_malloc.pass.cpp
+++ b/libcxxabi/test/test_fallback_malloc.pass.cpp
@@ -115,7 +115,7 @@ void exhaustion_test1 () {
     ptrs = alloc_series ( 32 );
     std::printf("Allocated %zu 32 byte chunks\n", ptrs.size());
     while ( ptrs.size () > 0 )
-        fallback_free ( pop ( ptrs, ptrs.size () % 1 == 1 ));
+        fallback_free ( pop ( ptrs, ptrs.size () % 2 == 1 ));
     print_free_list ();
 }
 
@@ -151,7 +151,7 @@ void exhaustion_test2 () {
     std::printf("Allocated %zu { 32, 48, 72, 108, 162 ... } byte chunks\n",
                 ptrs.size());
     while ( ptrs.size () > 0 )
-        fallback_free ( pop ( ptrs, ptrs.size () % 1 == 1 ));
+        fallback_free ( pop ( ptrs, ptrs.size () % 2 == 1 ));
     print_free_list ();
 
 }
@@ -185,7 +185,7 @@ void exhaustion_test3 () {
     ptrs = alloc_series ( allocs, sizeof ( allocs ) / sizeof ( allocs[0] ));
     std::printf("Allocated %zu chunks\n", ptrs.size());
     while ( ptrs.size () > 0 )
-        fallback_free ( pop ( ptrs, ptrs.size () % 1 == 1 ));
+        fallback_free ( pop ( ptrs, ptrs.size () % 2 == 1 ));
     print_free_list ();
 
 }

@github-actions

github-actions Bot commented Apr 21, 2026

Copy link
Copy Markdown

✅ With the latest revision this PR passed the C/C++ code formatter.

@dwrank
dwrank force-pushed the fix-issue-192773 branch from 829710f to d248718 Compare April 21, 2026 02:33
@dwrank
dwrank force-pushed the fix-issue-192773 branch from d248718 to c51cec4 Compare April 21, 2026 02:36
@ldionne ldionne changed the title [libcxxabi] Fix alternate deletions in exhaustion tests [libc++abi] Fix alternate deletions in exhaustion tests Jun 26, 2026
@ldionne
ldionne merged commit 7b8b8ff into llvm:main Jun 26, 2026
78 checks passed
LouisLu060211 pushed a commit to LouisLu060211/llvm-project that referenced this pull request Jun 30, 2026
maarcosrmz pushed a commit to maarcosrmz/llvm-project that referenced this pull request Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++abi libc++abi C++ Runtime Library. Not libc++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect is-odd-check in libc++abi's test_fallback_malloc.pass.cpp

3 participants