Fix asan/TestCases/Darwin/scrible.cpp
to work on platforms where `l…
#3237
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…ong` is not 64-bits.
Previously the test was failing on platforms where
long
was less than64-bits wide (e.g. older WatchOS simulators and arm64_32) because the
padding
field was too small.The test currently relies on the
my_object->isa
being scribbled orleft unmodified after
my_object
is freed. However, this was not thecase because the
isa
pointer intersected withChunkHeader::free_context_id
.free_context_id
starts at thebeginning of user memory but it only initialized once the memory is
freed. This caused the
isa
pointer to change after it was freedleading to the test crashing.
To fix this the
padding
field has been made explicitly 64-bits wide(same size as
ChunkHeader::free_context_id
).rdar://75806757
Differential Revision: https://reviews.llvm.org/D109409
(cherry picked from commit 7184114)