[all-commits] [llvm/llvm-project] 10a9ec: [flang] Fix crash in structure constructor lowerin...

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue Sep 30 10:36:31 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 10a9ec88501fa260002245fcd4d0c6f6ccae4e17
      https://github.com/llvm/llvm-project/commit/10a9ec88501fa260002245fcd4d0c6f6ccae4e17
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2025-09-30 (Tue, 30 Sep 2025)

  Changed paths:
    M flang/lib/Evaluate/constant.cpp
    A flang/test/Evaluate/Inputs/comporder1.mod
    A flang/test/Evaluate/Inputs/comporder2.mod
    A flang/test/Evaluate/comporder.f90

  Log Message:
  -----------
  [flang] Fix crash in structure constructor lowering (#160769)

MLIR types created by lowering for structure constructors appear to be
sensitive to the ordering of their components in the typed expression
representation used for structure constructors and derived type constant
values.

At present, the components appear in source position order. When some
ancestral types are defined in modules, this ordering can cause their
components to be ordered after components defined in extended derived
types. This can lead to crashes from incompatible MLIR types.

To avoid this issue, sort structure constructor components first in
ascending order of derived type extension depth; retain source position
ordering for components in the same derived type and for error recovery
situations.

Fixes https://github.com/llvm/llvm-project/issues/143740.



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