[PATCH] D41719: [InlineCost] Prevent infinite recursion on function pointers
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 3 15:36:24 PST 2018
efriedma added a comment.
The bug that's getting triggered by the testcase is that CallAnalyzer::analyzeCall is recursive, without any recursion limit, so it crashes by overflowing the stack.
Your patch doesn't solve that issue in general; it only solves the problem for your specific testcase. You could trigger a similar crash with a program that isn't recursive. Or there might be some other way to trick CallAnalyzer into following a recursive program. If you want to actually fix the bug, the solution is to either add a recursion depth limit, or make the algorithm iterative and add an iteration limit.
https://reviews.llvm.org/D41719
More information about the llvm-commits
mailing list