[all-commits] [llvm/llvm-project] 979d0e: [clang] fix out of bounds access in an empty strin...

Alex Lorenz via All-commits all-commits at lists.llvm.org
Wed Feb 2 11:16:25 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 979d0ee8ab30a175220af3b39a6df7d56de9d2c8
      https://github.com/llvm/llvm-project/commit/979d0ee8ab30a175220af3b39a6df7d56de9d2c8
  Author: Alex Lorenz <arphaman at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M clang/lib/Frontend/PrintPreprocessedOutput.cpp
    M clang/lib/Lex/Pragma.cpp
    A clang/test/Preprocessor/pragma-missing-string-token.c

  Log Message:
  -----------
  [clang] fix out of bounds access in an empty string when lexing a _Pragma with missing string token

The lexer can attempt to lex a _Pragma and crash with an out of bounds string access when it's
lexing a _Pragma whose string token is an invalid buffer, e.g. when a module header file from which the macro
expansion for that token was deleted from the file system.

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




More information about the All-commits mailing list