summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-04-03 09:55:45 -0700
committerKazu Hirata <kazu@google.com>2024-04-03 09:55:45 -0700
commit1189e87951e59a81ee097eae847c06008276fef1 (patch)
tree95c78d13dbaf9dad46cf4fd902055648f32d9975
parent5b702be1e80b8733786ac48ceaf04f2936616d1b (diff)
[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]
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index f70324d11a75..0c7f48fe0060 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -5601,7 +5601,7 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) {
EmitNullabilityCheck(LV, RV.getScalarVal(), E->getExprLoc());
if (LV.isBitField()) {
- llvm::Value *Result;
+ llvm::Value *Result = nullptr;
// If bitfield sanitizers are enabled we want to use the result
// to check whether a truncation or sign change has occurred.
if (SanOpts.has(SanitizerKind::ImplicitBitfieldConversion))