[all-commits] [llvm/llvm-project] 108770: [flang][OpenMP] Fix crash in defaultmap(none) on s...
CHANDRA GHALE via All-commits
all-commits at lists.llvm.org
Thu Sep 24 02:08:46 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 108770859571a22679b9f5e871ac6ffc311b0f4e
https://github.com/llvm/llvm-project/commit/108770859571a22679b9f5e871ac6ffc311b0f4e
Author: CHANDRA GHALE <chandra.nitdgp at gmail.com>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
M flang/lib/Semantics/resolve-directives.cpp
M flang/test/Semantics/OpenMP/defaultmap-clause-none.f90
Log Message:
-----------
[flang][OpenMP] Fix crash in defaultmap(none) on structure constructors (#220994)
Fixes :
[https://github.com/llvm/llvm-project/issues/218929](https://github.com/llvm/llvm-project/issues/218929)
Flang was crashing when a target defaultmap(none:...) region contained a
structure constructor, like this:
```
program p
type t
end type
type(t) :: x
!$omp target defaultmap(none:aggregate)
x = t()
!$omp end target
end
```
The problem is in `IsOpenMPAggregate` and `IsOpenMPScalar`. When the
OpenMP attribute visitor walks the names in the region, it hits the t in
t(), which resolves to the derived-type definition symbol rather than a
variable. `Symbol::GetType() `returns nullptr for such a symbol, and
both helpers dereferenced that pointer directly `(type->category())`
without checking, causing a segfault. The fix adds a null check to both
helpers returning false since a symbol with no declared type belongs to
no defaultmap category.
Co-authored-by: Chandra Ghale <ghale at pe34genoa.hpc.amslabs.hpecorp.net>
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