[PATCH] D36307: [Support/GlobPattern] - Treat multiple stars('*') as single.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 20:42:10 PDT 2017


ruiu added a comment.

I mean, I believe you can still hang this up by passing the following inputs (or something like that, I didn't test this):

  Pattern: a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*z
  Input: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

This is a fundamental limitation of the current algorithm because it's based on backtracking, which is exponential in the worst case. There are better algorithms, but I don't think we need that complexity here. In this test case, you are intentionally trying to break the linker, and it breaks as you wish. You simply shouldn't do that. I don't think we need  to "fix" this.


https://reviews.llvm.org/D36307





More information about the llvm-commits mailing list