Skip to content

Commit

Permalink
[asan][windows] Further relax how deep in the callstack main can be i…
Browse files Browse the repository at this point in the history
…n some asan tests

This is needed because there will be an extra layer of wrapper when linking to the static-CRT after the static asan runtime is removed
by #81677.
  • Loading branch information
barcharcraz committed May 15, 2024
1 parent 7605ad8 commit ff57a26
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions compiler-rt/test/asan/TestCases/Windows/bitfield_uaf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ int main(void) {
// CHECK: [[ADDR]] is located 0 bytes inside of 4-byte region
// CHECK-LABEL: freed by thread T0 here:
// CHECK: {{#0 .* free }}
// CHECK: {{ #[1-2] .* main .*bitfield_uaf.cpp}}:[[@LINE-4]]
// CHECK: {{ #[1-3] .* main .*bitfield_uaf.cpp}}:[[@LINE-4]]
// CHECK-LABEL: previously allocated by thread T0 here:
// CHECK: {{#0 .* malloc }}
// CHECK: {{ #[1-2] .* main .*bitfield_uaf.cpp}}:[[@LINE-8]]
// CHECK: {{ #[1-3] .* main .*bitfield_uaf.cpp}}:[[@LINE-8]]
make_access(s);
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ int main() {
// CHECK: [[ADDR]] is located 4 bytes before 168-byte region
// CHECK: allocated by thread T0 here:
// CHECK: {{#0 .* calloc }}
// CHECK: {{ #[1-2] .* main .*calloc_left_oob.cpp}}:[[@LINE-8]]
// CHECK: {{ #[1-3] .* main .*calloc_left_oob.cpp}}:[[@LINE-8]]
free(buffer);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ int main() {
// CHECK: [[ADDR]] is located 0 bytes after 168-byte region
// CHECK: allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* calloc }}
// CHECK: {{ #[1-2] .* main .*calloc_right_oob.cpp}}:[[@LINE-8]]
// CHECK: {{ #[1-3] .* main .*calloc_right_oob.cpp}}:[[@LINE-8]]
free(buffer);
}
4 changes: 2 additions & 2 deletions compiler-rt/test/asan/TestCases/Windows/calloc_uaf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ int main() {
// CHECK: [[ADDR]] is located 0 bytes inside of 168-byte region
// CHECK: freed by thread T0 here:
// CHECK-NEXT: {{#0 .* free }}
// CHECK: {{ #[1-2] .* main .*calloc_uaf.cpp}}:[[@LINE-8]]
// CHECK: {{ #[1-3] .* main .*calloc_uaf.cpp}}:[[@LINE-8]]
// CHECK: previously allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* calloc }}
// CHECK: {{ #[1-2] .* main .*calloc_uaf.cpp}}:[[@LINE-12]]
// CHECK: {{ #[1-3] .* main .*calloc_uaf.cpp}}:[[@LINE-12]]
}

0 comments on commit ff57a26

Please sign in to comment.