[all-commits] [llvm/llvm-project] a9c5e5: [clang] Fix crash with follow-on diagnostics w/inv...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Thu Oct 1 04:44:15 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a9c5e57c03413e31a9293a4d938402e6204ff888
      https://github.com/llvm/llvm-project/commit/a9c5e57c03413e31a9293a4d938402e6204ff888
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2026-10-01 (Thu, 01 Oct 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.md
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/Sema/fp16vec-sema.c
    M clang/test/Sema/vector-ops.c
    M clang/test/SemaCXX/vector.cpp

  Log Message:
  -----------
  [clang] Fix crash with follow-on diagnostics w/invalid logical operator (#227837)

If the logical operator involves a vector operand, we perform special
vector-specific checks. `CheckVectorOperands()` returns a null QualType
to signal there was an issue, and `CheckVectorLogicalOperands()` was
using that signal to decide to report an "invalid operands to binary
expression" diagnostic. However, `CheckVectorOperands()` also sometimes
modifies the given LHS and RHS values and when that happens, the caller
cannot assume they're still valid on a null QualType return. This was
causing a crash from `CheckVectorLogicalOperands()` because it was
attempting to use those newly invalidated expressions.

This fixes the crash by letting `CheckVectorOperands()` report the
diagnostics directly and removing the fallback logic from
`CheckVectorLogicalOperands()`. This also helpfully removes some
unhelpful follow-on diagnostics in other cases where we would report
"cannot convert operands" followed by "invalid operands to binary
expression".

Fixes #227588



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list