Skip to content

Commit 2ecbe73

Browse files
jayfoadtru
authored andcommitted
[flang] Fix dereference of std::optional with no value
Differential Revision: https://reviews.llvm.org/D142648 (cherry picked from commit 6772966)
1 parent 0e227de commit 2ecbe73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flang/lib/Optimizer/Builder/Character.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ void fir::factory::CharacterExprHelper::createAssign(
422422
(lhsCstLen && rhsCstLen && *lhsCstLen == *rhsCstLen) ||
423423
(rhs.getLen() == lhs.getLen());
424424

425-
if (compileTimeSameLength && *lhsCstLen == 1) {
425+
if (compileTimeSameLength && lhsCstLen && *lhsCstLen == 1) {
426426
createLengthOneAssign(lhs, rhs);
427427
return;
428428
}

0 commit comments

Comments
 (0)