[all-commits] [llvm/llvm-project] 8f0c86: Fix a crash with empty escape sequences when lexin...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Thu Aug 8 04:33:01 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8f0c865d1024a9ff7f3f1b0d3e47a6c9f5f672c2
      https://github.com/llvm/llvm-project/commit/8f0c865d1024a9ff7f3f1b0d3e47a6c9f5f672c2
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2024-08-08 (Thu, 08 Aug 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Lex/LiteralSupport.cpp
    M clang/test/Lexer/char-escapes-delimited.c

  Log Message:
  -----------
  Fix a crash with empty escape sequences when lexing (#102339)

The utilities we use for lexing string and character literals can be run
in a mode where we pass a null pointer for the diagnostics engine. This
mode is used by the format string checkers, for example. However, there
were two places that failed to account for a null diagnostic engine
pointer: `\o{}` and `\x{}`.

This patch adds a check for a null pointer and correctly handles
fallback behavior.

Fixes #102218



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list