Skip to content

Commit 37ca791

Browse files
committed
Fix crash when -bs-g is used on untagged variants.
See #6496 While deprecation is being discussed, this prevents the compiler crashes.
1 parent 75afc52 commit 37ca791

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/core/js_dump.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,8 @@ and expression_desc cxt ~(level : int) f x : cxt =
949949
| false, 1 -> Js_op.Lit Literals.tl
950950
| _ -> Js_op.Lit ("_" ^ string_of_int i)),
951951
e ))
952-
(if !Js_config.debug && not_is_cons then [(name_symbol, E.str p.name)]
952+
(if !Js_config.debug && (not untagged) && not_is_cons then
953+
[(name_symbol, E.str p.name)]
953954
else [])
954955
in
955956
if untagged || (not_is_cons = false && p.num_nonconst = 1) then tails

0 commit comments

Comments
 (0)