[PATCH] D133582: [ASan] rename internal references to left of/right of.
Evgenii Stepanov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 12 14:09:06 PDT 2022
eugenis added a comment.
I think I'd rather keep left/right as internal concepts and only translate them to before/after in the output.
================
Comment at: compiler-rt/lib/asan/asan_allocator.cpp:75
// U -- user memory.
-// R -- right redzone (0 or more bytes)
+// B -- back redzone (0 or more bytes)
// ChunkBase consists of ChunkHeader and other bytes that overlap with user
----------------
I don't get this. Why P and S vs F and B?
================
Comment at: compiler-rt/lib/asan/asan_allocator.cpp:443
+ if (state_before != state_after) {
+ if (state_before == CHUNK_ALLOCATED)
+ return chunk_before;
----------------
Not sure about this either. Before can be understood as in time or in space, while left and right are unambiguous, as soon as we agree on conceptual memory layout.
================
Comment at: compiler-rt/lib/asan/asan_thread.cpp:393
while (shadow_ptr >= shadow_bottom &&
- (*shadow_ptr != kAsanStackLeftRedzoneMagic &&
+ (*shadow_ptr != kAsanStackFrontRedzoneMagic &&
*shadow_ptr != kAsanStackMidRedzoneMagic &&
----------------
Every time I read front/back I have to stop and think which is which. The terms make sense for a container, but IMHO not for a chunk of memory.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133582/new/
https://reviews.llvm.org/D133582
More information about the llvm-commits
mailing list