mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-0: Fix EMPTY needs to still include language userops.
This commit is contained in:
@@ -523,8 +523,7 @@ class DecoderExecutor extends FoldingExecutor implements DisassemblerContextAdap
|
||||
* @param the computed reachability of the source block. Use {@link CtxReach#WITHOUT_CTXMOD} for
|
||||
* the seed.
|
||||
*/
|
||||
private void collectCtxReach(Map<JitBlock, CtxReach> into, JitBlock cur,
|
||||
CtxReach how) {
|
||||
private void collectCtxReach(Map<JitBlock, CtxReach> into, JitBlock cur, CtxReach how) {
|
||||
CtxReach curHow = into.get(cur);
|
||||
|
||||
if (blockModifiesContext(cur)) {
|
||||
|
||||
@@ -140,7 +140,7 @@ public class PcodeProgram {
|
||||
throw new IllegalArgumentException("Instruction must be parsed using Sleigh");
|
||||
}
|
||||
PcodeOp[] pcode = instruction.getPcode(includeOverrides);
|
||||
return new PcodeProgram(slang, List.of(pcode), PcodeUseropSymbolMap.EMPTY);
|
||||
return new PcodeProgram(slang, List.of(pcode), PcodeUseropSymbolMap.empty(slang));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,8 +162,8 @@ public class PcodeProgram {
|
||||
InjectContext ctx = library.buildInjectContext();
|
||||
InjectPayload payload = library.getPayload(type, name);
|
||||
PcodeOp[] pcode = payload.getPcode(program, ctx);
|
||||
return new PcodeProgram((SleighLanguage) program.getLanguage(), List.of(pcode),
|
||||
PcodeUseropSymbolMap.EMPTY);
|
||||
SleighLanguage language = (SleighLanguage) program.getLanguage();
|
||||
return new PcodeProgram(language, List.of(pcode), PcodeUseropSymbolMap.empty(language));
|
||||
}
|
||||
|
||||
protected final SleighLanguage language;
|
||||
|
||||
@@ -51,17 +51,10 @@ public interface PcodeUseropLibrary<T> {
|
||||
*/
|
||||
record PcodeUseropSymbolMap(SleighLanguage language, Map<Integer, UserOpSymbol> byIndex,
|
||||
Map<String, UserOpSymbol> byName) {
|
||||
public PcodeUseropSymbolMap {
|
||||
if (!byIndex.isEmpty() || !byName.isEmpty()) {
|
||||
Objects.requireNonNull(language);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The empty set of symbols
|
||||
*/
|
||||
public static final PcodeUseropSymbolMap EMPTY =
|
||||
new PcodeUseropSymbolMap(null, Map.of(), Map.of());
|
||||
public static PcodeUseropSymbolMap empty(SleighLanguage language) {
|
||||
return new PcodeUseropSymbolMap(language, Map.of());
|
||||
}
|
||||
|
||||
private static Map<String, UserOpSymbol> byName(Map<Integer, UserOpSymbol> byIndex) {
|
||||
return byIndex.values()
|
||||
|
||||
Reference in New Issue
Block a user