mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-23 00:24:11 -08:00
Fix bug in dependency analyzer
This commit is contained in:
parent
2bbdf6caba
commit
945a0fee9d
|
@ -120,10 +120,14 @@ public class DependencyNode implements ValueDependencyInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
boolean copied = false;
|
||||||
for (int i = 0; i < newTypes.length; ++i) {
|
for (int i = 0; i < newTypes.length; ++i) {
|
||||||
DependencyType type = newTypes[i];
|
DependencyType type = newTypes[i];
|
||||||
if (addType(type) && filter(type)) {
|
if (addType(type) && filter(type)) {
|
||||||
newTypes[j++] = type;
|
newTypes[j++] = type;
|
||||||
|
} else if (!copied) {
|
||||||
|
copied = true;
|
||||||
|
newTypes = newTypes.clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
|
|
|
@ -51,10 +51,13 @@ class DependencyNodeToNodeTransition implements DependencyConsumer {
|
||||||
|
|
||||||
void consume(DependencyType[] types) {
|
void consume(DependencyType[] types) {
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
boolean copied = false;
|
||||||
for (DependencyType type : types) {
|
for (DependencyType type : types) {
|
||||||
|
boolean added = false;
|
||||||
if (filterType(type)) {
|
if (filterType(type)) {
|
||||||
if (!destination.hasType(type)) {
|
if (!destination.hasType(type)) {
|
||||||
types[j++] = type;
|
types[j++] = type;
|
||||||
|
added = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.getName().startsWith("[")) {
|
if (type.getName().startsWith("[")) {
|
||||||
|
@ -65,6 +68,10 @@ class DependencyNodeToNodeTransition implements DependencyConsumer {
|
||||||
source.getClassValueNode().connect(destination.getClassValueNode());
|
source.getClassValueNode().connect(destination.getClassValueNode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!added && !copied) {
|
||||||
|
copied = true;
|
||||||
|
types = types.clone();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user