File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
java/ql/test/library-tests/dataflow/callctx Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -60,4 +60,40 @@ void test(C1 c) {
6060 new C2 ().wrapFoo2 (source ("C2.2" ));
6161 wrapFoo3 (new C2 (), source ("C2.3" ));
6262 }
63+
64+ static class Sup {
65+ void wrap (Object x ) {
66+ tgt (x );
67+ }
68+
69+ void tgt (Object x ) {
70+ sink (x ); // $ hasValueFlow=s
71+ }
72+ }
73+
74+ static class A1 extends Sup {
75+ void tgt (Object x ) {
76+ sink (x ); // $ hasValueFlow=s hasValueFlow=s12
77+ }
78+ }
79+
80+ static class A2 extends Sup {
81+ void tgt (Object x ) {
82+ sink (x ); // $ hasValueFlow=s hasValueFlow=s12
83+ }
84+ }
85+
86+ static class A3 extends Sup {
87+ void tgt (Object x ) {
88+ sink (x ); // $ hasValueFlow=s
89+ }
90+ }
91+
92+ void test2 (Sup s ) {
93+ s .wrap (source ("s" ));
94+
95+ if (s instanceof A1 || s instanceof A2 ) {
96+ s .wrap (source ("s12" ));
97+ }
98+ }
6399}
You can’t perform that action at this time.
0 commit comments