[all-commits] [llvm/llvm-project] 859d92: Fix a failing assertion with vector type initializ...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Wed May 4 10:25:49 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 859d92394812c0e5e650ab337717719b9687e5ce
      https://github.com/llvm/llvm-project/commit/859d92394812c0e5e650ab337717719b9687e5ce
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2022-05-04 (Wed, 04 May 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/Sema/vector-init.c

  Log Message:
  -----------
  Fix a failing assertion with vector type initialization

When constant evaluating the initializer for an object of vector type,
we would call APInt::trunc() but truncate to the same bit-width the
object already had, which would cause an assertion. Instead, use
APInt::truncOrSelf() so that we no longer assert in this situation.

Fix #50216




More information about the All-commits mailing list