File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1823,20 +1823,25 @@ end
1823
1823
"""
1824
1824
set_retained_vns_del!(vi::VarInfo)
1825
1825
1826
- Set the `"del"` flag of variables in `vi` with `order > num_produce` to `true`.
1826
+ Set the `"del"` flag of variables in `vi` with `order > num_produce` to `true`. If
1827
+ `num_produce` is `0`, _all_ variables will have their `"del"` flag set to `true`.
1827
1828
1828
1829
Will error if `vi` does not have an accumulator for `VariableOrder`.
1829
1830
"""
1830
1831
function set_retained_vns_del! (vi:: VarInfo )
1831
1832
if ! hasacc (vi, Val (:VariableOrder ))
1832
1833
msg = " `vi` must have an accumulator for VariableOrder to set the `del` flag."
1833
- raise (ArgumentError (msg))
1834
+ throw (ArgumentError (msg))
1834
1835
end
1835
1836
num_produce = get_num_produce (vi)
1836
1837
for vn in keys (vi)
1837
- order = getorder (vi, vn)
1838
- if order > num_produce
1838
+ if num_produce == 0
1839
1839
set_flag! (vi, vn, " del" )
1840
+ else
1841
+ order = getorder (vi, vn)
1842
+ if order > num_produce
1843
+ set_flag! (vi, vn, " del" )
1844
+ end
1840
1845
end
1841
1846
end
1842
1847
return nothing
You can’t perform that action at this time.
0 commit comments