Fail a bit more informatively on a bad get_element_ptr_dyn.

This commit is contained in:
Roy Frostig 2010-09-03 15:07:58 -07:00
parent eb90be7798
commit 1fa978ebb9
1 changed files with 6 additions and 2 deletions

View File

@ -768,8 +768,12 @@ let trans_visitor
add_to vc sz;
Il.Mem (based v, elt_rty)
end
| _ -> bug () "get_element_ptr_dyn %d on cell %s" i
(cell_str mem_cell)
| Il.Mem (_, Il.StructTy elts) ->
bug ()
"get_element_ptr dyn %d out of bounds (len %d) on cell %s"
i (Array.length elts) (cell_str mem_cell)
| _ ->
bug () "get_element_ptr_dyn %d on cell %s" i (cell_str mem_cell)
in
let get_element_ptr_dyn_in_current_frame