mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-4712 Code review cachec lookup changes
This commit is contained in:
parent
19cf2fba3c
commit
35cbc81d59
1 changed files with 10 additions and 8 deletions
|
@ -375,13 +375,15 @@ public class SleighLanguage implements Language {
|
|||
new SleighInstructionPrototype(this, buf, context, contextcache, inDelaySlot, null);
|
||||
Integer hashcode = newProto.hashCode();
|
||||
|
||||
if (!instructProtoMap.containsKey(hashcode)) {
|
||||
newProto.cacheInfo(buf, context, true);
|
||||
}
|
||||
res = instructProtoMap.putIfAbsent(hashcode, newProto);
|
||||
// if there was no previous value, assume newProto inserted
|
||||
// check proto map for already defined prototype
|
||||
res = instructProtoMap.get(hashcode);
|
||||
if (res == null) {
|
||||
res = newProto;
|
||||
newProto.cacheInfo(buf, context, true);
|
||||
res = instructProtoMap.putIfAbsent(hashcode, newProto);
|
||||
// if there was no previous value, assume newProto inserted
|
||||
if (res == null) {
|
||||
res = newProto;
|
||||
}
|
||||
}
|
||||
|
||||
if (inDelaySlot && res.hasDelaySlots()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue