diff options
author | Kazu Hirata <kazu@google.com> | 2024-04-03 09:55:45 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2024-04-03 09:55:45 -0700 |
commit | 1189e87951e59a81ee097eae847c06008276fef1 (patch) | |
tree | 95c78d13dbaf9dad46cf4fd902055648f32d9975 | |
parent | 5b702be1e80b8733786ac48ceaf04f2936616d1b (diff) | |
download | llvm-1189e87951e59a81ee097eae847c06008276fef1.zip llvm-1189e87951e59a81ee097eae847c06008276fef1.tar.gz llvm-1189e87951e59a81ee097eae847c06008276fef1.tar.bz2 |
[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.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index f70324d..0c7f48f 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)) |