Skip to content

Commit bcaeb39

Browse files
committed
Be defensive: fall-through unsolved row constraints
1 parent 879701c commit bcaeb39

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/row.ml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,14 @@ let%debug5_sexp eliminate_variables (env : environment) ({ dims; bcast; id } as
21122112
match Map.find env.row_env v with
21132113
| Some (Bounds_row { constr = Total_elems { numerator = Num_elems 1; _ }; _ }) ->
21142114
elim_var :: elim_dims
2115-
| Some (Bounds_row { constr = Total_elems _; _ }) -> assert false
2115+
| Some (Bounds_row { constr = Total_elems _ as constr; lub; _ }) ->
2116+
let stage = Stage7 in
2117+
let ineqs, _env =
2118+
eliminate_row_constraint ~depth:0 stage ~lub (row_of_var v id)
2119+
(subst_row_constraint stage env constr)
2120+
env
2121+
in
2122+
ineqs @ elim_dims
21162123
| _ -> elim_var :: elim_dims)
21172124

21182125
let empty_env = { dim_env = Map.empty (module Dim_var); row_env = Map.empty (module Row_var) }

0 commit comments

Comments
 (0)