[clang] [clang] fix wrong result of pointers comparison between unknown and stack (PR #122404)
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 10 00:09:06 PST 2025
https://github.com/steakhal requested changes to this pull request.
In general, the concept of having the memory space directly embedded into a memory region is flawed. And that is the root cause of the problem.
Ideally, the property of "in what memory space does this region live in" is a trait, that could be changed as we learn about aliasing properties in the program.
As such, we should be able to say, we didn't know exactly what is the memory space of a symbol, but now that we learned that this is equal to some other memory region that lives on the stack, we must also live on the stack.
So ideally, we would purge the whole memoryspace portion of the memregion class hierarchy.
As an easier workaround, we could probably get away with having this program trait defined only for memregions that have UnknownMemorySpace. This way we could fix these issues while saving some work of completely rewriting the whole memregion class hierarchy. (I tried that, and it's not trivial.)
@Flandini could you please chim in and collaborate with him/her?
https://github.com/llvm/llvm-project/pull/122404
More information about the cfe-commits
mailing list