[all-commits] [llvm/llvm-project] 817550: [Lex] Don't assert when decoding invalid UCNs.

Sam McCall via All-commits all-commits at lists.llvm.org
Thu May 5 23:52:10 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 817550919e78ba9bb8336685fe1f40e4f650b2e4
      https://github.com/llvm/llvm-project/commit/817550919e78ba9bb8336685fe1f40e4f650b2e4
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-05-06 (Fri, 06 May 2022)

  Changed paths:
    M clang/lib/Lex/LiteralSupport.cpp
    M clang/test/Lexer/unicode.c

  Log Message:
  -----------
  [Lex] Don't assert when decoding invalid UCNs.

Currently if a lexically-valid UCN encodes an invalid codepoint, then we
diagnose that, and then hit an assertion while trying to decode it.

Since there isn't anything preventing us reaching this state, remove the
assertion. expandUCNs("X\UAAAAAAAAY") will produce "XY".

Differential Revision: https://reviews.llvm.org/D125059




More information about the All-commits mailing list