Dataflow: Add test highlighting bug.

This commit is contained in:
Anders Schack-Mulligen
2024-07-23 14:34:33 +02:00
parent ff8bb2b1f8
commit f598a0b607
2 changed files with 47 additions and 0 deletions

View File

@@ -46,4 +46,50 @@ public class A {
Object x = source("6");
test6sink(x);
}
Object getSrc() {
return source("get");
}
void srcField() {
foo = source("field");
}
static Object foo = null;
void srcCall(int i) {
test7(source("call"), i);
}
Object test7(Object x, int i) {
Object src = null;
if (i == 0) {
src = getSrc();
} else if (i == 1) {
src = foo;
} else if (i == 2) {
src = x;
} else if (i == 3) {
src = source("direct");
}
sinkPut(src);
foo2 = src;
sink(src); // $ EqCc="direct" SrcCc="field" SrcCc="call" SrcCc="direct" SinkCc="get" SinkCc="field" SinkCc="direct"
return src;
}
static Object foo2 = null;
void sinkPut(Object x) {
sink(x); // $ SrcCc="field" SrcCc="call" SrcCc="direct"
}
void sinkField() {
sink(foo2); // $ SrcCc="field" SrcCc="call" SrcCc="direct" SinkCc="get" SinkCc="field" SinkCc="call" SinkCc="direct"
}
void sinkReturn(int i) {
sink(test7(null, i)); // $ SrcCc="field" SinkCc="get" SinkCc="field" SinkCc="direct"
}
}

View File

@@ -1,2 +1,3 @@
testFailures
| A.java:78:10:78:12 | src | Unexpected result: SinkCc="call" |
failures