Skip to content

Commit d758d3c

Browse files
authored
Merge pull request #3237 from apple/eng/PR-75806757-cherry-pick-20210726
Fix `asan/TestCases/Darwin/scrible.cpp` to work on platforms where `l…
2 parents 52df6ad + 21ce042 commit d758d3c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler-rt/test/asan/TestCases/Darwin/scribble.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ struct Isa {
1313
};
1414

1515
struct MyClass {
16-
long padding;
16+
// User memory and `ChunkHeader` overlap. In particular the `free_context_id`
17+
// is stored at the beginning of user memory when it is freed. That part of
18+
// user memory is not scribbled and is changed when the memory is freed. This
19+
// test relies on `isa` being scribbled or unmodified after memory is freed.
20+
// In order for this to work the start of `isa` must come after whatever is in
21+
// `ChunkHeader` (currently the 64-bit `free_context_id`). The padding here is
22+
// to ensure this is the case.
23+
uint64_t padding;
1724
Isa *isa;
1825
long data;
1926

0 commit comments

Comments
 (0)