Skip to content

Commit 85515a9

Browse files
authored
Merge branch 'breaking' into mhauru/logprobacc
2 parents 1aac709 + 05cd886 commit 85515a9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/varinfo.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,19 +1830,19 @@ end
18301830
"""
18311831
set_retained_vns_del!(vi::VarInfo)
18321832
1833-
Set the `"del"` flag of variables in `vi` with `order > num_produce` to `true`.
1833+
Set the `"del"` flag of variables in `vi` with `order > num_produce` to `true`. If
1834+
`num_produce` is `0`, _all_ variables will have their `"del"` flag set to `true`.
18341835
18351836
Will error if `vi` does not have an accumulator for `VariableOrder`.
18361837
"""
18371838
function set_retained_vns_del!(vi::VarInfo)
18381839
if !hasacc(vi, Val(:VariableOrder))
18391840
msg = "`vi` must have an accumulator for VariableOrder to set the `del` flag."
1840-
raise(ArgumentError(msg))
1841+
throw(ArgumentError(msg))
18411842
end
18421843
num_produce = get_num_produce(vi)
18431844
for vn in keys(vi)
1844-
order = getorder(vi, vn)
1845-
if order > num_produce
1845+
if num_produce == 0 || getorder(vi, vn) > num_produce
18461846
set_flag!(vi, vn, "del")
18471847
end
18481848
end

0 commit comments

Comments
 (0)