Skip to content

Commit 1189e87

Browse files
[CodeGen] Fix a warning
This patch fixes: clang/lib/CodeGen/CGExpr.cpp:5607:11: error: variable 'Result' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
1 parent 5b702be commit 1189e87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5601,7 +5601,7 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) {
56015601
EmitNullabilityCheck(LV, RV.getScalarVal(), E->getExprLoc());
56025602

56035603
if (LV.isBitField()) {
5604-
llvm::Value *Result;
5604+
llvm::Value *Result = nullptr;
56055605
// If bitfield sanitizers are enabled we want to use the result
56065606
// to check whether a truncation or sign change has occurred.
56075607
if (SanOpts.has(SanitizerKind::ImplicitBitfieldConversion))

0 commit comments

Comments
 (0)