We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7f9b26 commit e3b2db8Copy full SHA for e3b2db8
compiler/lib/eval.ml
@@ -311,8 +311,8 @@ let eval_branch info = function
311
Meanwhile, add guards to prevent Invalid_argument("index out of bounds")
312
see https://github.com/ocsigen/js_of_ocaml/issues/485 *)
313
match the_case_of info (Pv x) with
314
- | CConst j when j < Array.length const -> Branch const.(j)
315
- | CTag j when j < Array.length tags -> Branch tags.(j)
+ | CConst j when j >= 0 && j < Array.length const -> Branch const.(j)
+ | CTag j when j >= 0 && j < Array.length tags -> Branch tags.(j)
316
| CConst _ | CTag _ | Unknown -> b)
317
| _ as b -> b
318
0 commit comments