[all-commits] [llvm/llvm-project] b293c6: [clang][Lexer] Fix crash/assert clang::HeaderSearc...

Dmitry Polukhin via All-commits all-commits at lists.llvm.org
Thu Mar 16 02:32:00 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b293c6280d06f49c5ca7290855911341ab0bdffa
      https://github.com/llvm/llvm-project/commit/b293c6280d06f49c5ca7290855911341ab0bdffa
  Author: Dmitry Polukhin <dmitry.polukhin at gmail.com>
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
    M clang/lib/Lex/HeaderSearch.cpp
    A clang/test/Preprocessor/Inputs/header-search-crash/foo.hmap.json
    A clang/test/Preprocessor/header-search-crash.c

  Log Message:
  -----------
  [clang][Lexer] Fix crash/assert clang::HeaderSearch::search_dir_nth

The issue was introduced in D135801. When there are only header maps in the SearchDirs,
the out of bounds value is assigned to FirstNonHeaderMapSearchDirIdx.

Test Plan: check-clang

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




More information about the All-commits mailing list