[all-commits] [llvm/llvm-project] e43851: [AIX][AsmPrinter] Fix unsigned subtraction wrap-ar...

Hubert Tong via All-commits all-commits at lists.llvm.org
Wed Jan 8 20:08:18 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e438513f2e2ff7a19c671983ff22a14909c96859
      https://github.com/llvm/llvm-project/commit/e438513f2e2ff7a19c671983ff22a14909c96859
  Author: Hubert Tong <hubert.reinterpretcast at gmail.com>
  Date:   2025-01-09 (Thu, 09 Jan 2025)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    A llvm/test/CodeGen/PowerPC/global-merge-aix-zero-size-struct.ll

  Log Message:
  -----------
  [AIX][AsmPrinter] Fix unsigned subtraction wrap-around (#122214)

Unsigned subtraction wrap-around occurs in `emitGlobalConstantImpl` on
an AIX-specific code path from 8e4423eb0888 when a structure type has
zero elements.

With assertions enabled, this manifests as:
```
TypeSize llvm::StructLayout::getElementOffset(unsigned int) const: Assertion `Idx < NumElements && "Invalid element idx!"' failed.
```



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