Skip to content

Commit 0efb5e8

Browse files
committed
internal/core/adt: fix counter issue
Use -- instead of ++. This did not cause any issues as the disjunct counter is only used to silence certain counter mismatches. So this bug had the effect of missing failed decremented counters. This is why the number of counter errors significantly increases with this change. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I34da95f17ecf898b42e08ac59e4295459855ff41 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207441 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent c880efb commit 0efb5e8

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

internal/core/adt/eval_test.go

+12-5
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,28 @@ var needFix = map[string]string{
7676
// counter errors.
7777
// TODO: These counters should all go to zero.
7878
var skipDebugDepErrors = map[string]int{
79+
"benchmarks/disjunctelim": 1,
7980
"benchmarks/issue1684": 16,
8081
"builtins/default": 1,
8182
"compile/scope": 1,
8283
"comprehensions/pushdown": 2,
83-
"cycle/comprehension": 2,
84+
"cycle/builtins": 2,
85+
"cycle/comprehension": 3,
8486
"cycle/disjunction": 4,
8587
"cycle/evaluate": 1,
88+
"cycle/issue990": 1,
8689
"cycle/structural": 17,
90+
"disjunctions/edge": 1,
8791
"disjunctions/errors": 3,
88-
"disjunctions/elimination": 15,
89-
"disjunctions/embed": 6,
92+
"disjunctions/elimination": 19,
93+
"disjunctions/embed": 12,
9094
"disjunctions/nested": 1,
95+
"eval/conjuncts": 3,
9196
"eval/disjunctions": 3,
92-
"eval/notify": 17,
93-
"fulleval/054_issue312": 1,
97+
"eval/issue545": 1,
98+
"eval/notify": 22,
99+
"export/030": 2,
100+
"fulleval/054_issue312": 2,
94101
"scalars/embed": 2,
95102
}
96103

internal/core/adt/fields.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ func (c *closeContext) decDisjunct(ctx *OpContext, kind depKind) {
734734
// TODO: the counters are only used in debug mode and we could skip this
735735
// if debug is disabled.
736736
for ; c != nil; c = c.parent {
737-
c.disjunctCount++
737+
c.disjunctCount--
738738
}
739739
}
740740

0 commit comments

Comments
 (0)