forked from OSchip/llvm-project
Fix use of uninitialized value added in r189400 (found by MemorySanitizer)
llvm-svn: 189456
This commit is contained in:
parent
ed8f1c6dce
commit
a3a037df63
|
@ -54,7 +54,7 @@ PPCMCExpr::EvaluateAsRelocatableImpl(MCValue &Res,
|
||||||
const MCAsmLayout *Layout) const {
|
const MCAsmLayout *Layout) const {
|
||||||
MCValue Value;
|
MCValue Value;
|
||||||
|
|
||||||
if (Layout && !getSubExpr()->EvaluateAsRelocatable(Value, *Layout))
|
if (!Layout || !getSubExpr()->EvaluateAsRelocatable(Value, *Layout))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (Value.isAbsolute()) {
|
if (Value.isAbsolute()) {
|
||||||
|
@ -85,7 +85,7 @@ PPCMCExpr::EvaluateAsRelocatableImpl(MCValue &Res,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Res = MCValue::get(Result);
|
Res = MCValue::get(Result);
|
||||||
} else if (Layout) {
|
} else {
|
||||||
MCContext &Context = Layout->getAssembler().getContext();
|
MCContext &Context = Layout->getAssembler().getContext();
|
||||||
const MCSymbolRefExpr *Sym = Value.getSymA();
|
const MCSymbolRefExpr *Sym = Value.getSymA();
|
||||||
MCSymbolRefExpr::VariantKind Modifier = Sym->getKind();
|
MCSymbolRefExpr::VariantKind Modifier = Sym->getKind();
|
||||||
|
@ -118,8 +118,7 @@ PPCMCExpr::EvaluateAsRelocatableImpl(MCValue &Res,
|
||||||
}
|
}
|
||||||
Sym = MCSymbolRefExpr::Create(&Sym->getSymbol(), Modifier, Context);
|
Sym = MCSymbolRefExpr::Create(&Sym->getSymbol(), Modifier, Context);
|
||||||
Res = MCValue::get(Sym, Value.getSymB(), Value.getConstant());
|
Res = MCValue::get(Sym, Value.getSymB(), Value.getConstant());
|
||||||
} else
|
}
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue