[all-commits] [llvm/llvm-project] 6eadc8: [Clang] Fix crash in Parser::ParseDirectDeclarator...

Shafik Yaghmour via All-commits all-commits at lists.llvm.org
Tue Sep 12 11:20:20 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6eadc8f16e03f6aa3b1b1c178c308ac452eabeac
      https://github.com/llvm/llvm-project/commit/6eadc8f16e03f6aa3b1b1c178c308ac452eabeac
  Author: Shafik Yaghmour <shafik.yaghmour at intel.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Parse/ParseDecl.cpp
    A clang/test/Parser/gh64836.cpp

  Log Message:
  -----------
  [Clang] Fix crash in Parser::ParseDirectDeclarator by adding check that token is not an annotation token

In Parser::ParseDirectDeclarator(...) in some cases ill-formed code can cause an
annotation token to end up where it was not expected. The fix is to add a
!Tok.isAnnotation() guard before attempting to access identifier info.

This fixes: https://github.com/llvm/llvm-project/issues/64836

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




More information about the All-commits mailing list