Skip to content

Commit 57bd313

Browse files
committed
handle_array_pointer_var_check
1 parent a80c393 commit 57bd313

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7930,10 +7930,12 @@ class MappableExprsHandler {
79307930
ElementType = CAT->getElementType().getTypePtr();
79317931
else if (VAT)
79327932
ElementType = VAT->getElementType().getTypePtr();
7933-
else
7934-
assert(&Component == &*Components.begin() &&
7935-
"Only expect pointer (non CAT or VAT) when this is the "
7936-
"first Component");
7933+
else if (&Component == &*Components.begin()) {
7934+
// Handle pointer-based array sections like data[a:b:c]
7935+
if (const auto *PtrType = Ty->getAs<PointerType>()) {
7936+
ElementType = PtrType->getPointeeType().getTypePtr();
7937+
}
7938+
}
79377939
// If ElementType is null, then it means the base is a pointer
79387940
// (neither CAT nor VAT) and we'll attempt to get ElementType again
79397941
// for next iteration.

0 commit comments

Comments
 (0)