diff --git a/teavm-core/src/main/java/org/teavm/optimization/VariableUsageGraphBuilder.java b/teavm-core/src/main/java/org/teavm/optimization/VariableUsageGraphBuilder.java index 31309d0b4..121bc7c05 100644 --- a/teavm-core/src/main/java/org/teavm/optimization/VariableUsageGraphBuilder.java +++ b/teavm-core/src/main/java/org/teavm/optimization/VariableUsageGraphBuilder.java @@ -137,6 +137,9 @@ public class VariableUsageGraphBuilder { @Override public void visit(GetFieldInstruction insn) { + if (insn.getInstance() != null) { + use(insn.getReceiver(), insn.getInstance()); + } } @Override