Rather than rewriting the alloca pointer to zero, use removePointerBase() to drop the base pointer. This will simply bail if the base pointer is not the alloca. We could try doing something more fancy here (like dropping the sources not based on the alloca on the premise that they aren't SafeStack-relevant or something), but I don't think that's worthwhile.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM
In some cases, we could prove that the access is either in-range, or not based on the alloca. (For example, given an alloca "a" and an access "min(a,b)+1", the pointer is either "a+1", or "b+1". "a+1" is in range, and "b" is unrelated to the alloca, so the access is safe.) But it seems unlikely to be important.