[PATCH] D114003: LiteralSupport: Don't assert() on invalid input

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 17 03:06:58 PST 2021


sammccall added a comment.

Added a bit of analysis on https://github.com/clangd/clangd/issues/888.

The short version is we built a PCH. When consuming it, the parser decides to re-lex and this means sources must be loaded from disk.
These sources are inconsistent with the PCH, so the precondition that the input range describes a reasonable literal doesn't hold.

This patch fixes it by removing the precondition and defending against it instead.
This seems like an OK fallback unless there's hundreds of other places where we might re-lex and make similar assumptions.
I'm going to dig and try to find out but if anyone knows about this it'd be nice to chime in :-)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114003/new/

https://reviews.llvm.org/D114003



More information about the cfe-commits mailing list