[all-commits] [llvm/llvm-project] 38f153: [TableGen] Fix null-pointer assert in RecordVal::s...

Prerona Chaudhuri via All-commits all-commits at lists.llvm.org
Mon May 4 12:58:44 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 38f153c7a7f1dd060d3afabc05f0fcb0585a10cb
      https://github.com/llvm/llvm-project/commit/38f153c7a7f1dd060d3afabc05f0fcb0585a10cb
  Author: Prerona Chaudhuri <pchaudhuri at nvidia.com>
  Date:   2026-05-04 (Mon, 04 May 2026)

  Changed paths:
    M llvm/lib/TableGen/Record.cpp
    A llvm/test/TableGen/incompatible-field-override.td

  Log Message:
  -----------
  [TableGen] Fix null-pointer assert in RecordVal::setValue on failed cast (#195492)

When setValue's getCastTo failed, Value was overwritten with nullptr
instead of being left untouched.
The "no value set" sentinel is UnsetInit, not nullptr, so a downstream
RecordResolver::resolve that called isa<UnsetInit>(RV->getValue()) would
assert on the null pointer when a later def tried to resolve an
expression referring to that field.

Compute the cast into a local and only commit to Value on success, so a
type-incompatible override (e.g. redeclaring an int field as string in a
subclass) reports the existing "is incompatible" error and exits cleanly
instead of aborting.

Fixes issue : https://github.com/llvm/llvm-project/issues/184879
Assisted by Claude.



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