Skip to content

Commit 215a126

Browse files
committed
[clang] Check for null TypeSourceInfo in Sema::CreateUnaryExprOrTypeTraitExpr
1 parent c13f806 commit 215a126

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4629,6 +4629,9 @@ ExprResult Sema::CreateUnaryExprOrTypeTraitExpr(TypeSourceInfo *TInfo,
46294629
TInfo->getType()->isVariablyModifiedType())
46304630
TInfo = TransformToPotentiallyEvaluated(TInfo);
46314631

4632+
if (!TInfo)
4633+
return ExprError();
4634+
46324635
// C99 6.5.3.4p4: the type (an unsigned integer type) is size_t.
46334636
return new (Context) UnaryExprOrTypeTraitExpr(
46344637
ExprKind, TInfo, Context.getSizeType(), OpLoc, R.getEnd());

0 commit comments

Comments
 (0)