Skip to content

[asan,test] Make alloca_loop_unpoisoning.cpp robust and fix s390x failure #78774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions compiler-rt/test/asan/TestCases/alloca_loop_unpoisoning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// RUN: %env_asan_opts=detect_stack_use_after_return=0 %run %t 2>&1
//
// REQUIRES: stable-runtime
// UNSUPPORTED: target=s390{{.*}}

// This testcase checks that allocas and VLAs inside loop are correctly unpoisoned.

Expand All @@ -25,11 +24,15 @@ void *top, *bot;
__attribute__((noinline)) void foo(int len) {
char x;
top = &x;
char array[len];
volatile char array[len];
if (len)
array[0] = 0;
assert(!(reinterpret_cast<uintptr_t>(array) & 31L));
alloca(len);
for (int i = 0; i < 32; ++i) {
char array[i];
volatile char array[i];
if (i)
array[0] = 0;
bot = alloca(i);
assert(!(reinterpret_cast<uintptr_t>(bot) & 31L));
}
Expand Down