|
|
|
|
|
by stensal
2719 days ago
|
|
Yes, you have stated it correctly. The size and liveness information are from allocations (either stack or heap). ASAN and Valgrind do not associate these information with pointers, but add redzones (extra paddings with special bit patterns) before and after each legit memory block. It only triggers error reporting if a pointer happens to point to one of the redzones. However, redzones always have limited sizes. They cannot cover the ranges of out-of-bound pointers. It's dynamic typing. |
|
How does type punning work? Does you compiler scribble the types a pointer has been cast to in the object descriptor?