aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCParser
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-01-28 06:22:14 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-01-28 06:22:14 +0000
commit8b01c82f25aaea12340f53789ba59a2527713b9e (patch)
tree674aaf9f3ddbc3e748718dcc8bd49533e01cd246 /lib/MC/MCParser
parente71cc86ad10143173195182f28bf90844f682436 (diff)
Small improvement to the recursion detection logic from the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCParser')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index 8acdf38400..c5a483c144 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -1565,7 +1565,9 @@ static bool IsUsedIn(const MCSymbol *Sym, const MCExpr *Value) {
return false;
case MCExpr::SymbolRef: {
const MCSymbol &S = static_cast<const MCSymbolRefExpr*>(Value)->getSymbol();
- return &S.AliasedSymbol() == Sym;
+ if (S.isVariable())
+ return IsUsedIn(Sym, S.getVariableValue());
+ return &S == Sym;
}
case MCExpr::Unary:
return IsUsedIn(Sym, static_cast<const MCUnaryExpr*>(Value)->getSubExpr());