diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MC/MCExpr.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp index 4c92bbb..d6e545f 100644 --- a/lib/MC/MCExpr.cpp +++ b/lib/MC/MCExpr.cpp @@ -181,8 +181,11 @@ bool MCExpr::EvaluateAsRelocatable(MCContext &Ctx, MCValue &Res) const { case SymbolRef: { const MCSymbol &Sym = cast<MCSymbolRefExpr>(this)->getSymbol(); - if (const MCExpr *Value = Ctx.GetSymbolValue(&Sym)) - return Value->EvaluateAsRelocatable(Ctx, Res); + + // Evaluate recursively if this is a variable. + if (Sym.isVariable()) + return Sym.getValue()->EvaluateAsRelocatable(Ctx, Res); + Res = MCValue::get(&Sym, 0, 0); return true; } |