[all-commits] [llvm/llvm-project] 3c5721: Fix a failing assertion with -Wcast-align

Aaron Ballman via All-commits all-commits at lists.llvm.org
Wed Jul 7 11:01:47 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3c5721d77275d2a7bdaeeadd0b1c3864f1166110
      https://github.com/llvm/llvm-project/commit/3c5721d77275d2a7bdaeeadd0b1c3864f1166110
  Author: Queen Dela Cruz <qdelacru at cisco.com>
  Date:   2021-07-07 (Wed, 07 Jul 2021)

  Changed paths:
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/Sema/warn-cast-align.c

  Log Message:
  -----------
  Fix a failing assertion with -Wcast-align

When there is unknown type in a struct in code compiled with
-Wcast-align, the compiler crashes due to
clang::ASTContext::getASTRecordLayout() failing an assert.

Added check that the RecordDecl is valid before calling
getASTRecordLayout().




More information about the All-commits mailing list