[PATCH] D54504: [stack-safety] Local analysis implementation

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 20 16:28:27 PST 2018


eugenis added inline comments.


================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:321
+        }
+        // Don't visit function return value: if it depends on the alloca, then
+        // argument range would be full-set.
----------------
vitalybuka wrote:
> vlad.tsyrklevich wrote:
> > Is this comment outdated? I can't figure out what it's referring to, Maybe @eugenis knows.
> This is correct but not optimal behavior. I've added FIXME: into "case Instruction::Ret:" and new test into IPA analysis
Right. We could track return values of function call the same as we track allocas and arguments, and have each function describe its return value as possibly being equal to an argument pointer with an offset range. I have not seen too many cases like that, and opted for simplicity: consider anything that escapes through return value untrackable and, on the caller side, consider return values safe (i.e. unrelated to any tracked object).

Btw, I don't like the name "leak". I think the usual term for this is escaped pointer / alloca, but full-set range is also possible when we can not prove anything about the range of offsets in a memory access - even if it is the only access. Rename it to smth like setUnknown() ?



Repository:
  rL LLVM

https://reviews.llvm.org/D54504





More information about the llvm-commits mailing list