Skip to content

Commit 847d3d3

Browse files
committed
Fix the detector for KP-19142
1 parent 9eb8747 commit 847d3d3

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

lkql_checker/share/lkql/kp/KP-19142.lkql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fun is_assigned(id, body) =
1212
& concat([eh.f_stmts.children
1313
for eh in body.f_exceptions.children
1414
if eh is ExceptionHandler].to_list);
15-
stdlib.any([s is AssignStmt when s.f_dest.p_referenced_defining_name == id
15+
stdlib.any([s is AssignStmt when s.f_dest.p_referenced_defining_name() == id
1616
for s in stmts])
1717
}
1818

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
main.adb:17:19: rule violation: possible occurrence of KP 19142
2+
17 | procedure Test_Implicit (I : Implicit; Mut : out Mutable) is -- FLAG
3+
| ^^^^^^^^^^^^^
4+
5+
main.adb:29:30: rule violation: possible occurrence of KP 19142
6+
29 | overriding procedure Test_Explicit (I : Explicit; Mut : out Mutable) is -- FLAG
7+
| ^^^^^^^^^^^^^
8+
9+
main.adb:44:19: rule violation: possible occurrence of KP 19142
10+
44 | procedure Test_Subtype (I : Sub; Mut : out Sub_Mutable) is -- FLAG
11+
| ^^^^^^^^^^^^
12+
13+
main.adb:51:19: rule violation: possible occurrence of KP 19142
14+
51 | procedure Test_Derived (I : Derived; Mut : out Derived_Mutable) is -- FLAG
15+
| ^^^^^^^^^^^^
16+
17+
main.adb:58:19: rule violation: possible occurrence of KP 19142
18+
58 | procedure Test_Private (I : Priv; Mut: out Private_Mutable) is -- FLAG
19+
| ^^^^^^^^^^^^
20+
21+
main.adb:65:19: rule violation: possible occurrence of KP 19142
22+
65 | procedure Test_Read_And_Write (I : Read_And_Write; Mut : in out Mutable) is -- FLAG
23+
| ^^^^^^^^^^^^^^^^^^^
24+
25+
main.adb:72:19: rule violation: possible occurrence of KP 19142
26+
72 | procedure Test_Exc_Hand (I : Exc_Hand; Mut : out Mutable) is -- FLAG
27+
| ^^^^^^^^^^^^^
28+
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
driver: checker
2-
rule_name: KP_19142
2+
rule_name: kp_19142
33
project: prj.gpr
4-
control:
5-
- ["XFAIL", "True", "KP detector is invalid (eng/libadalang/langkit-query-language#506)"]

0 commit comments

Comments
 (0)