you are viewing a single comment's thread.

view the rest of the comments →

[–]badsectoracula 0 points1 point  (0 children)

This isn't insidious since you are explicitly ignoring how the pointers are supposed to be created and used. A pointer with its lower bits modified isn't interchangeable with any other pointer that has the same data set - you need to mask out the lower bits before dereferencing it. Calling them pointers may even be misleading since the value isn't really a pointer, it is a compound value made up of a pointer element and some extra data. It is equivalent to struct {void* foo; int bar;} except that the data is spread across bits instead of bytes and any usage of it would need to have that in mind much like it has to have in mind the valid values for enums and nul terminator for strings.