Skip to content

Commit 1999af0

Browse files
committed
Remove difference on termination analysis tests.
1 parent 1328fa1 commit 1999af0

File tree

2 files changed

+38
-23
lines changed

2 files changed

+38
-23
lines changed

analysis/reanalyze/src/Arnold.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ module FindFunctionsCalled = struct
545545
let findCallees (expression : Typedtree.expression) =
546546
let isFunction =
547547
match expression.exp_desc with
548-
| Texp_function _ -> true
548+
| Texp_function {arity = None} -> true
549549
| _ -> false
550550
in
551551
let callees = ref StringSet.empty in

tests/analysis_tests/tests-reanalyze/termination/expected/termination.txt

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,15 @@
7070
Termination Analysis for butSecondArgumentIsAlwaysEvaluated
7171

7272
Function Table
73-
1 parseExpression: [_ || _]; [+Parser.next; parseExpression; parseExpression; _ || parseInt]
74-
2 parseInt: [_ || _]; +Parser.next; _
75-
3 parseList<f>: parseList$loop<f:f>
76-
4 parseList$loop<f>: [_ || f; parseList$loop<f:f>; _]
77-
5 parseListExpression: _
78-
6 parseListExpression2: parseExpression; parseList<f:parseExpression>
79-
7 parseListInt: parseList<f:parseInt>
80-
8 parseListIntTailRecursive: parseListIntTailRecursive$loop
81-
9 parseListIntTailRecursive$loop: [_ || parseInt; parseListIntTailRecursive$loop]
82-
10 parseListListInt: parseList<f:parseListInt>
73+
1 parseExpression: [_ || _]; [+Parser.next; parseExpression; parseExpression; _ || _]
74+
2 parseList<f>: parseList$loop<f:f>
75+
3 parseList$loop<f>: [_ || f; parseList$loop<f:f>; _]
76+
4 parseListExpression: _
77+
5 parseListExpression2: parseExpression; parseList<f:parseExpression>
78+
6 parseListInt: _
79+
7 parseListIntTailRecursive: parseListIntTailRecursive$loop
80+
8 parseListIntTailRecursive$loop: [_ || parseListIntTailRecursive$loop]
81+
9 parseListListInt: parseList<f:parseListInt>
8382

8483
Termination Analysis for parseListInt
8584

@@ -112,13 +111,10 @@
112111

113112
Function Table
114113
1 alwaysReturnNone: [+Parser.next; alwaysReturnNone || None]
115-
2 parseIntO: [+Parser.next; Some || None]
116-
3 parseIntOWrapper: parseIntO
117-
4 parseListIntO: parseListO<f:parseIntO>
118-
5 parseListO<f>: parseListO$loop<f:f>
119-
6 parseListO$loop<f>: [+Parser.next; _ || switch f {some: parseListO$loop<f:f>, none: _}]
120-
7 testAlwaysReturnNone: alwaysReturnNone
121-
8 thisMakesNoProgress: None; [_ || +Parser.next; Some]
114+
2 parseIntOWrapper: _
115+
3 parseListIntO: _
116+
4 testAlwaysReturnNone: alwaysReturnNone
117+
5 thisMakesNoProgress: None; [_ || +Parser.next; Some]
122118

123119
Termination Analysis for parseListIntO
124120

@@ -153,10 +149,10 @@
153149
Termination Analysis Stats
154150
Files:1
155151
Recursive Blocks:21
156-
Functions:49
157-
Infinite Loops:10
158-
Hygiene Errors:2
159-
Cache Hits:7/30
152+
Functions:45
153+
Infinite Loops:12
154+
Hygiene Errors:3
155+
Cache Hits:4/21
160156

161157

162158
Error Termination
@@ -211,6 +207,10 @@
211207
TestCyberTruck.res:217:32-73
212208
Call must have named argument f
213209

210+
Error Hygiene
211+
TestCyberTruck.res:198:29-53
212+
Named argument f must be passed a recursive function
213+
214214
Error Termination
215215
TestCyberTruck.res:180:15-21
216216
Possible infinite loop when calling parseList$loop<f:f> which is parseList$loop<f:parseListInt>
@@ -219,6 +219,21 @@
219219
2 parseList<f:parseListInt> (TestCyberTruck.res 201)
220220
1 parseListListInt (TestCyberTruck.res 201)
221221

222+
Error Termination
223+
TestCyberTruck.res:180:15-21
224+
Possible infinite loop when calling parseList$loop<f:f> which is parseList$loop<f:parseExpression>
225+
CallStack:
226+
3 parseList$loop<f:parseExpression> (TestCyberTruck.res 183)
227+
2 parseList<f:parseExpression> (TestCyberTruck.res 220)
228+
1 parseListExpression2 (TestCyberTruck.res 220)
229+
230+
Error Termination
231+
TestCyberTruck.res:228:7-38
232+
Possible infinite loop when calling parseListIntTailRecursive$loop
233+
CallStack:
234+
2 parseListIntTailRecursive$loop (TestCyberTruck.res 230)
235+
1 parseListIntTailRecursive (TestCyberTruck.res 223)
236+
222237
Error Termination
223238
TestCyberTruck.res:238:31-49
224239
Possible infinite loop when calling loopAfterProgress
@@ -231,4 +246,4 @@
231246
CallStack:
232247
1 countRendersCompiled (TestCyberTruck.res 283)
233248

234-
Analysis reported 12 issues (Error Hygiene:2, Error Termination:10)
249+
Analysis reported 15 issues (Error Hygiene:3, Error Termination:12)

0 commit comments

Comments
 (0)