Skip to content

Commit 0149532

Browse files
committed
Avoid potential null deref of OASE
1 parent 66a9f99 commit 0149532

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7447,7 +7447,7 @@ class MappableExprsHandler {
74477447
// Update info about the lowest and highest elements for this struct
74487448
if (!PartialStruct.Base.isValid()) {
74497449
PartialStruct.LowestElem = {FieldIndex, LowestElem};
7450-
if (IsFinalArraySection) {
7450+
if (IsFinalArraySection && OASE) {
74517451
Address HB =
74527452
CGF.EmitArraySectionExpr(OASE, /*IsLowerBound=*/false)
74537453
.getAddress();
@@ -7460,7 +7460,7 @@ class MappableExprsHandler {
74607460
} else if (FieldIndex < PartialStruct.LowestElem.first) {
74617461
PartialStruct.LowestElem = {FieldIndex, LowestElem};
74627462
} else if (FieldIndex > PartialStruct.HighestElem.first) {
7463-
if (IsFinalArraySection) {
7463+
if (IsFinalArraySection && OASE) {
74647464
Address HB =
74657465
CGF.EmitArraySectionExpr(OASE, /*IsLowerBound=*/false)
74667466
.getAddress();

0 commit comments

Comments
 (0)