Skip to content

Commit fd8afce

Browse files
committed
Avoid unchecked dereferences of sym.ref()
1 parent 1ec2fc4 commit fd8afce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flang/lib/Lower/OpenMP/Utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ mlir::Value createParentSymAndGenIntermediateMaps(
302302
/// Checks if an omp::Object is an array expression with a subscript, e.g.
303303
/// array(1,2).
304304
auto isArrayExprWithSubscript = [](omp::Object obj) {
305-
if (auto maybeRef = evaluate::ExtractDataRef(*obj.ref())) {
305+
if (auto maybeRef = evaluate::ExtractDataRef(obj.ref())) {
306306
evaluate::DataRef ref = *maybeRef;
307307
if (auto *arr = std::get_if<evaluate::ArrayRef>(&ref.u))
308308
return !arr->subscript().empty();
@@ -453,7 +453,7 @@ getComponentObject(std::optional<Object> object,
453453
if (!object)
454454
return std::nullopt;
455455

456-
auto ref = evaluate::ExtractDataRef(*object.value().ref());
456+
auto ref = evaluate::ExtractDataRef(object.value().ref());
457457
if (!ref)
458458
return std::nullopt;
459459

0 commit comments

Comments
 (0)