aboutsummaryrefslogtreecommitdiff
path: root/lib/MC
diff options
context:
space:
mode:
authorShantonu Sen <ssen@apple.com>2011-02-09 21:03:19 +0000
committerShantonu Sen <ssen@apple.com>2011-02-09 21:03:19 +0000
commit80fd30563c341d6db778f407547707396ff97c75 (patch)
treec3b0589cab1ede4f7071b7a611af4a3e28bd658f /lib/MC
parent697ffd61a47af38ac932628e942d75952f901fcd (diff)
Fix comparator used for looking up previously instantiated EDDisassemblers.
Now, Syntax is only used as a tie-breaker if the Arch matches. Previously, a request for x86_64 disassembler followed by the i386 disassembler in a single process would return the cached x86_64 disassembler. Fixes <rdar://problem/8958982> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125215 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCDisassembler/EDDisassembler.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/MC/MCDisassembler/EDDisassembler.h b/lib/MC/MCDisassembler/EDDisassembler.h
index fdbe7ad24c..71e45f0b04 100644
--- a/lib/MC/MCDisassembler/EDDisassembler.h
+++ b/lib/MC/MCDisassembler/EDDisassembler.h
@@ -89,8 +89,10 @@ struct EDDisassembler {
bool operator<(const CPUKey &key) const {
if(Arch > key.Arch)
return false;
- if(Syntax >= key.Syntax)
- return false;
+ else if (Arch == key.Arch) {
+ if(Syntax > key.Syntax)
+ return false;
+ }
return true;
}
};