[PATCH] D43092: [DebugInfo] Prevent infinite recursion for malformed DWARF

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 16:27:06 PST 2018


dblaikie added a comment.

>> Ideally/the original version of this, I think was non-recursive and only specifically looked for certain attributes in order and then stopped. I'd sort of rather than, because it's more constrained.
> 
> The original `find()` still exists, so I'd expect this variant only to be used where the recursive property is needed.

'find()' only searches the current DIE. findRecursively is needed when looking through abstract or specification references - but these aren't, so far as I know, arbitrarily nested (you can't have an unlimited chain of abstract/specifications - really you can only have at most one of each, in a specific order (abstract then specification) - as far as I recall/know). So unlimited recursion is a bit overpowered here.

Could you check the revision history here? I'm pretty sure the first version of this I reviewed from Greg wasn't recursive - and then it became recursive at some point to handle something needed, but maybe those decisions need to be reexamined?


https://reviews.llvm.org/D43092





More information about the llvm-commits mailing list