Do not recurse into symbol refs that have a variant kind. This prevents us
from losing the variant when producing a relocation on an alias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117037 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp
index 3524b80..abc3b51 100644
--- a/lib/MC/MCExpr.cpp
+++ b/lib/MC/MCExpr.cpp
@@ -306,7 +306,7 @@
const MCSymbol &Sym = SRE->getSymbol();
// Evaluate recursively if this is a variable.
- if (Sym.isVariable())
+ if (Sym.isVariable() && SRE->getKind() == MCSymbolRefExpr::VK_None)
return Sym.getVariableValue()->EvaluateAsRelocatableImpl(Res, Layout,
true);