Merge remote-tracking branch 'origin/GP-0_Dan_fixTests-2025-12-18-1'

This commit is contained in:
Ryan Kurtz
2025-12-18 09:24:48 -05:00

View File

@@ -22,6 +22,7 @@ import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
import org.junit.Test; import org.junit.Test;
import org.objectweb.asm.ClassWriter;
import generic.Unique; import generic.Unique;
import ghidra.app.plugin.processors.sleigh.SleighLanguage; import ghidra.app.plugin.processors.sleigh.SleighLanguage;
@@ -29,6 +30,7 @@ import ghidra.app.plugin.processors.sleigh.SleighLanguageHelper;
import ghidra.pcode.emu.jit.AbstractJitTest; import ghidra.pcode.emu.jit.AbstractJitTest;
import ghidra.pcode.emu.jit.alloc.AlignedMpIntHandler; import ghidra.pcode.emu.jit.alloc.AlignedMpIntHandler;
import ghidra.pcode.emu.jit.analysis.JitType.DoubleJitType; import ghidra.pcode.emu.jit.analysis.JitType.DoubleJitType;
import ghidra.pcode.emu.jit.gen.util.Emitter;
import ghidra.pcode.emu.jit.var.JitVar; import ghidra.pcode.emu.jit.var.JitVar;
import ghidra.pcode.emu.jit.var.JitVarnodeVar; import ghidra.pcode.emu.jit.var.JitVarnodeVar;
import ghidra.pcode.exec.*; import ghidra.pcode.exec.*;
@@ -66,6 +68,10 @@ public class JitAllocationModelTest extends AbstractJitTest {
JitVarnodeVar tempVar = Unique.assertOne(varnodeVars(dfm) JitVarnodeVar tempVar = Unique.assertOne(varnodeVars(dfm)
.filter(v -> v.varnode().isUnique())); .filter(v -> v.varnode().isUnique()));
ClassWriter cw = new ClassWriter(0);
Emitter<?> em = Emitter.start(cw.visitMethod(0, "none", "()V", null, null));
am.allocate(em.rootScope());
if (!(am.getHandler(tempVar) instanceof AlignedMpIntHandler handler)) { if (!(am.getHandler(tempVar) instanceof AlignedMpIntHandler handler)) {
throw new AssertionFailedError(); throw new AssertionFailedError();
} }
@@ -100,6 +106,10 @@ public class JitAllocationModelTest extends AbstractJitTest {
.sorted(Comparator.comparing(JitVar::id)) .sorted(Comparator.comparing(JitVar::id))
.toList(); .toList();
ClassWriter cw = new ClassWriter(0);
Emitter<?> em = Emitter.start(cw.visitMethod(0, "none", "()V", null, null));
am.allocate(em.rootScope());
/** /**
* NOTE: Variables are coalesced by varnode, so all of these will receive the same handler, * NOTE: Variables are coalesced by varnode, so all of these will receive the same handler,
* and so will all have the same type. There being two float ops will cause the type and * and so will all have the same type. There being two float ops will cause the type and