Fix dependency bug with monitorenter/monitorexit

This commit is contained in:
Alexey Andreev 2015-02-16 17:54:47 +04:00
parent b4c3bc47f0
commit 9300c07daf

View File

@ -495,16 +495,20 @@ class DependencyGraphBuilder {
@Override
public void monitorEnter(VariableReader objectRef) {
dependencyChecker.linkMethod(
new MethodReference(Object.class, "monitorEnter", Object.class, void.class),
new CallLocation(caller.getMethod(), currentLocation)).use();
MethodDependency methodDep = dependencyChecker.linkMethod(
new MethodReference(Object.class, "monitorEnter", Object.class, void.class),
new CallLocation(caller.getMethod(), currentLocation));
nodes[objectRef.getIndex()].connect(methodDep.getVariable(1));
methodDep.use();
}
@Override
public void monitorExit(VariableReader objectRef) {
dependencyChecker.linkMethod(
MethodDependency methodDep = dependencyChecker.linkMethod(
new MethodReference(Object.class, "monitorExit", Object.class, void.class),
new CallLocation(caller.getMethod(), currentLocation)).use();
new CallLocation(caller.getMethod(), currentLocation));
nodes[objectRef.getIndex()].connect(methodDep.getVariable(1));
methodDep.use();
}
};
}