Commit 750adf58 authored by Yudi Zheng's avatar Yudi Zheng

BugFixes:

	Small-order-snippet will be closer to the selected region.
	ClassInfo fixing will be handled correctly.
parent 9d59b1ce
......@@ -73,7 +73,7 @@ public class Snippet implements Comparable<Snippet> {
}
public int compareTo(Snippet o) {
return order - o.getOrder();
return o.getOrder() - order;
}
public void init(LocalVars allLVs, Map<Type, Proc> processors,
......
......@@ -20,6 +20,7 @@ import org.objectweb.asm.tree.analysis.BasicValue;
import org.objectweb.asm.tree.analysis.Frame;
import org.objectweb.asm.tree.analysis.SourceValue;
import ch.usi.dag.disl.classcontext.ClassContext;
import ch.usi.dag.disl.coderep.Code;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.exception.DiSLFatalException;
......@@ -121,9 +122,12 @@ public class WeavingCode {
}
LdcInsnNode ldc = (LdcInsnNode) previous;
MethodInsnNode invocation = (MethodInsnNode) instr;
MethodInsnNode invoke = (MethodInsnNode) instr;
if (!(ldc.cst instanceof String)) {
if (!((ldc.cst instanceof String)
&& invoke.owner.equals(Type
.getInternalName(ClassContext.class)) && invoke.name
.equals("asClass"))) {
continue;
}
......@@ -133,7 +137,7 @@ public class WeavingCode {
iList.insert(instr, new LdcInsnNode(clazz));
iList.remove(ldc.getPrevious());
iList.remove(ldc);
iList.remove(invocation);
iList.remove(invoke);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment