internal/core/adt: fix counter related to close builtin
The spawnCloseContext used to pass isClosedOnce
might never be incremented itself. As a result
decDependent might never be called and the parent
never decremented.
We use the DEFER counter to agitate an increment
and decrement after the conjunct is added.
The case where the counter is removed is in
builtins/default, most notably the line:
Close: close(*{} | 0)
Note that this also increases a counter, which
is always a possibility. We deal with that later.
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I18e9759a7958addb36ad437b6be0f49f43d7ea6a
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207519
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>