llvm.org GIT mirror llvm / ead2d5a
Fix use of uninitialized value added in r189400 (found by MemorySanitizer) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189456 91177308-0d34-0410-b5e6-96231b3b80d8 Alexey Samsonov 6 years ago
1 changed file(s) with 3 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
5353 const MCAsmLayout *Layout) const {
5454 MCValue Value;
5555
56 if (Layout && !getSubExpr()->EvaluateAsRelocatable(Value, *Layout))
56 if (!Layout || !getSubExpr()->EvaluateAsRelocatable(Value, *Layout))
5757 return false;
5858
5959 if (Value.isAbsolute()) {
8484 break;
8585 }
8686 Res = MCValue::get(Result);
87 } else if (Layout) {
87 } else {
8888 MCContext &Context = Layout->getAssembler().getContext();
8989 const MCSymbolRefExpr *Sym = Value.getSymA();
9090 MCSymbolRefExpr::VariantKind Modifier = Sym->getKind();
117117 }
118118 Sym = MCSymbolRefExpr::Create(&Sym->getSymbol(), Modifier, Context);
119119 Res = MCValue::get(Sym, Value.getSymB(), Value.getConstant());
120 } else
121 return false;
120 }
122121
123122 return true;
124123 }