[all-commits] [llvm/llvm-project] 326a5a: Fix a bug in OptimizedStructLayout when filling ga...

John McCall via All-commits all-commits at lists.llvm.org
Wed Jul 21 12:47:33 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 326a5a2658d81db46a78b184fe42e522ef170f32
      https://github.com/llvm/llvm-project/commit/326a5a2658d81db46a78b184fe42e522ef170f32
  Author: John McCall <rjmccall at apple.com>
  Date:   2021-07-21 (Wed, 21 Jul 2021)

  Changed paths:
    M llvm/lib/Support/OptimizedStructLayout.cpp
    M llvm/unittests/Support/OptimizedStructLayoutTest.cpp

  Log Message:
  -----------
  Fix a bug in OptimizedStructLayout when filling gaps before
fixed fields with highly-aligned flexible fields.

The code was not considering the possibility that aligning
the current offset to the alignment of a queue might push
us past the end of the gap.  Subtracting the offsets to
figure out the maximum field size for the gap then overflowed,
making us think that we had nearly unbounded space to fill.

Fixes PR 51131.




More information about the All-commits mailing list