[all-commits] [llvm/llvm-project] ea72b5: bugprone-argument-comment: SourceLocation valid ju...

Liu Ke via All-commits all-commits at lists.llvm.org
Wed Oct 13 09:31:19 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ea72b55b5c7c281cb21bb7bd50e6e039ca63dfe8
      https://github.com/llvm/llvm-project/commit/ea72b55b5c7c281cb21bb7bd50e6e039ca63dfe8
  Author: liuke <liuke.gehry at bytedance.com>
  Date:   2021-10-13 (Wed, 13 Oct 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
    M clang-tools-extra/test/clang-tidy/checkers/bugprone-argument-comment.cpp

  Log Message:
  -----------
  bugprone-argument-comment: SourceLocation valid judgment avoid emitting coredump in isInSystemHeader

If the Node has an invalid location, it will trigger assert in
isInSystemHeader(...).

void test() {
  __builtin_va_list __args;
  // __builtin_va_list has no defination in any source file and its
  // CXXConstructorDecl has invalid sourcelocation
}
coredump with "Assertion `Loc.isValid() && "Can't get file
characteristic of invalid loc!"' failed." in
getFileCharacteristic(SourceLocation).




More information about the All-commits mailing list