Skip to content

Commit e910f61

Browse files
authored
[Flang][OpenMP] Fix type in getBaseObject causing crashes in certain scenarios (llvm#95472)
This typo would unfortunately cause code like the following to ICE, where common block symbols/names are used in a map clause: subroutine sb() implicit none integer:: b, c common /var/ b, c !$omp target map(tofrom: /var/) b = 1 c = 2 !$omp end target end subroutine
1 parent 86dc758 commit e910f61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flang/lib/Lower/OpenMP/Clauses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Object makeObject(const parser::OmpObject &object,
153153
std::optional<Object> getBaseObject(const Object &object,
154154
semantics::SemanticsContext &semaCtx) {
155155
// If it's just the symbol, then there is no base.
156-
if (!object.id())
156+
if (!object.ref())
157157
return std::nullopt;
158158

159159
auto maybeRef = evaluate::ExtractDataRef(*object.ref());

0 commit comments

Comments
 (0)