Skip to content

Commit 1fa978e

Browse files
committed
Fail a bit more informatively on a bad get_element_ptr_dyn.
1 parent eb90be7 commit 1fa978e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/boot/me/trans.ml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,12 @@ let trans_visitor
768768
add_to vc sz;
769769
Il.Mem (based v, elt_rty)
770770
end
771-
| _ -> bug () "get_element_ptr_dyn %d on cell %s" i
772-
(cell_str mem_cell)
771+
| Il.Mem (_, Il.StructTy elts) ->
772+
bug ()
773+
"get_element_ptr dyn %d out of bounds (len %d) on cell %s"
774+
i (Array.length elts) (cell_str mem_cell)
775+
| _ ->
776+
bug () "get_element_ptr_dyn %d on cell %s" i (cell_str mem_cell)
773777
in
774778

775779
let get_element_ptr_dyn_in_current_frame

0 commit comments

Comments
 (0)