[all-commits] [llvm/llvm-project] f023f5: [clang][JumpDiagnostics] ignore non-asm goto targe...

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Thu Jul 20 20:05:11 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f023f5cdb2e6c19026f04a15b5a935c041835d14
      https://github.com/llvm/llvm-project/commit/f023f5cdb2e6c19026f04a15b5a935c041835d14
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2023-07-20 (Thu, 20 Jul 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/JumpDiagnostics.cpp
    M clang/test/Sema/asm-goto.cpp
    M clang/test/SemaCXX/goto2.cpp

  Log Message:
  -----------
  [clang][JumpDiagnostics] ignore non-asm goto target scopes

The current behavior of JumpScopeChecker::VerifyIndirectOrAsmJumps was
to cross validate the scope of every jumping statement (goto, asm goto)
against the scope of every label (even if the label was not even a
possible target of the asm goto).

When we have multiple asm goto's with unique targets, we could trigger
false positive build errors complaining that labels that weren't even in
the asm goto's label list could not be jumped to.  Example:

    error: cannot jump from this asm goto statement to one of its possible targets
    asm goto(""::::foo);
    note: possible target of asm goto statement
    bar:
    ^

Fixes: https://github.com/ClangBuiltLinux/linux/issues/1886

Reviewed By: void, jyu2, rjmccall

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




More information about the All-commits mailing list