[PATCH] D85231: Protect against filenames with no extension at all.

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 4 14:00:06 PDT 2020


Could maybe add an assert along with the patch as well as an assert only
test?

On Tue, Aug 4, 2020, 1:42 PM Sterling Augustine via Phabricator <
reviews at reviews.llvm.org> wrote:

> saugustine added a comment.
>
> The darwin-dsymutil.c tests this code path right now on line 33. I found
> this error by running it under asan; otherwise it was fully latent.
>
> It seems pretty clear to me that when End == -1 (StringRef::npos),
> creating a string ref from that is obviously a bug.
>
> I'm not even sure how to check for a failure. clang will almost never
> crash; there is just a very subtle bounds violation or empty stringref. How
> it manifests itself depends on subsequent usage of the stringref, and stack
> layout.
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D85231/new/
>
> https://reviews.llvm.org/D85231
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200804/d7c0ad12/attachment.html>


More information about the cfe-commits mailing list