[all-commits] [llvm/llvm-project] 9a8d45: [Flang][OpenMP] Fix crash when block.end() is miss...

Jack Styles via All-commits all-commits at lists.llvm.org
Tue Jul 8 10:29:21 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9a8d45f6268112dce4950cd2f21628963546082f
      https://github.com/llvm/llvm-project/commit/9a8d45f6268112dce4950cd2f21628963546082f
  Author: Jack Styles <jack.styles at arm.com>
  Date:   2025-07-08 (Tue, 08 Jul 2025)

  Changed paths:
    M flang/lib/Semantics/canonicalize-omp.cpp
    A flang/test/Parser/OpenMP/loop-transformation-construct03.f90

  Log Message:
  -----------
  [Flang][OpenMP] Fix crash when block.end() is missed (#147519)

As reported in #145917 and #147309, there are situation's where flang
may crash. This is because `nextIt` in
`RewriteOpenMPLoopConstruct` gets re-assigned when an iterator is erased
from the block. If this is missed, Flang may attempt to access a
location in memory that is not accessable and cause a compiler crash.

This adds protection where the crash can occur, and a test with a
reproducer that can trigger the crash.

Fixes #147309



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