diff options
| author | Alexey Samsonov <samsonov@google.com> | 2013-08-28 08:30:47 +0000 | 
|---|---|---|
| committer | Alexey Samsonov <samsonov@google.com> | 2013-08-28 08:30:47 +0000 | 
| commit | a3a037df6342bd0cb60749ad5e824b708e5e05f4 (patch) | |
| tree | eb287106fc4ad8e7dfb65692af9b435198ad5423 /llvm/lib/Target | |
| parent | ed8f1c6dce6f82fda1477d668d798ac01d491367 (diff) | |
| download | bcm5719-llvm-a3a037df6342bd0cb60749ad5e824b708e5e05f4.tar.gz bcm5719-llvm-a3a037df6342bd0cb60749ad5e824b708e5e05f4.zip | |
Fix use of uninitialized value added in r189400 (found by MemorySanitizer)
llvm-svn: 189456
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp | 7 | 
1 files changed, 3 insertions, 4 deletions
| diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp index 633cd362dc3..d7e84021595 100644 --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp @@ -54,7 +54,7 @@ PPCMCExpr::EvaluateAsRelocatableImpl(MCValue &Res,                                       const MCAsmLayout *Layout) const {    MCValue Value; -  if (Layout && !getSubExpr()->EvaluateAsRelocatable(Value, *Layout)) +  if (!Layout || !getSubExpr()->EvaluateAsRelocatable(Value, *Layout))      return false;    if (Value.isAbsolute()) { @@ -85,7 +85,7 @@ PPCMCExpr::EvaluateAsRelocatableImpl(MCValue &Res,          break;      }      Res = MCValue::get(Result); -  } else if (Layout) { +  } else {      MCContext &Context = Layout->getAssembler().getContext();      const MCSymbolRefExpr *Sym = Value.getSymA();      MCSymbolRefExpr::VariantKind Modifier = Sym->getKind(); @@ -118,8 +118,7 @@ PPCMCExpr::EvaluateAsRelocatableImpl(MCValue &Res,      }      Sym = MCSymbolRefExpr::Create(&Sym->getSymbol(), Modifier, Context);      Res = MCValue::get(Sym, Value.getSymB(), Value.getConstant()); -  } else -    return false; +  }    return true;  } | 

