Do not forget to process rhs on unsupported lhs
This commit is contained in:
@@ -358,11 +358,11 @@ public class JetControlFlowProcessor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generateInstructions(rhs, false);
|
||||||
if (left instanceof JetSimpleNameExpression || left instanceof JetProperty) {
|
if (left instanceof JetSimpleNameExpression || left instanceof JetProperty) {
|
||||||
generateInstructions(rhs, false);
|
// Do nothing, just record write below
|
||||||
}
|
}
|
||||||
else if (left instanceof JetQualifiedExpression) {
|
else if (left instanceof JetQualifiedExpression) {
|
||||||
generateInstructions(rhs, false);
|
|
||||||
generateInstructions(((JetQualifiedExpression) left).getReceiverExpression(), false);
|
generateInstructions(((JetQualifiedExpression) left).getReceiverExpression(), false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
== bar ==
|
||||||
|
fun Int.bar(c: C) {
|
||||||
|
this = c
|
||||||
|
}
|
||||||
|
---------------------
|
||||||
|
L0:
|
||||||
|
<START> NEXT:[v(c: C)] PREV:[]
|
||||||
|
v(c: C) NEXT:[w(c)] PREV:[<START>]
|
||||||
|
w(c) NEXT:[r(c)] PREV:[v(c: C)]
|
||||||
|
r(c) NEXT:[unsupported(BINARY_EXPRESSION : this = c)] PREV:[w(c)]
|
||||||
|
unsupported(BINARY_EXPRESSION : this = c) NEXT:[<END>] PREV:[r(c)]
|
||||||
|
L1:
|
||||||
|
<END> NEXT:[<SINK>] PREV:[unsupported(BINARY_EXPRESSION : this = c)]
|
||||||
|
error:
|
||||||
|
<ERROR> NEXT:[<SINK>] PREV:[]
|
||||||
|
sink:
|
||||||
|
<SINK> NEXT:[] PREV:[<ERROR>, <END>]
|
||||||
|
=====================
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fun Int.bar(c: C) {
|
||||||
|
this = c
|
||||||
|
}
|
||||||
@@ -61,6 +61,11 @@ public class ControlFlowTestGenerated extends AbstractControlFlowTest {
|
|||||||
doTest("compiler/testData/cfg/arraySetPlusAssign.kt");
|
doTest("compiler/testData/cfg/arraySetPlusAssign.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("assignmentToThis.kt")
|
||||||
|
public void testAssignmentToThis() throws Exception {
|
||||||
|
doTest("compiler/testData/cfg/assignmentToThis.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("Assignments.kt")
|
@TestMetadata("Assignments.kt")
|
||||||
public void testAssignments() throws Exception {
|
public void testAssignments() throws Exception {
|
||||||
doTest("compiler/testData/cfg/Assignments.kt");
|
doTest("compiler/testData/cfg/Assignments.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user