Skip to content

Commit

Permalink
[CodeGen] Fix a warning
Browse files Browse the repository at this point in the history
This patch fixes:

  clang/lib/CodeGen/CGExpr.cpp:5607:11: error: variable 'Result' is
  used uninitialized whenever 'if' condition is false
  [-Werror,-Wsometimes-uninitialized]
  • Loading branch information
kazutakahirata committed Apr 3, 2024
1 parent 5b702be commit 1189e87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CGExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 1189e87

Please sign in to comment.