Skip to content

Commit 9b7458b

Browse files
dulmarodmeta-codesync[bot]
authored andcommitted
[swift] Remove a crash
Summary: Make a crash into an internal error without crashing when an unexpected type is found. Reviewed By: ngorogiannis Differential Revision: D91229829 fbshipit-source-id: 16d150c55c7609e12f645de2d89ce194ff51b4d8
1 parent 8dd0739 commit 9b7458b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

infer/src/llvm/Llair2Textual.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,9 @@ let rec to_textual_exp ~(proc_state : ProcState.t) loc ?generate_typ_exp (exp :
467467
| Textual.Typ.(Ptr (Struct name)) ->
468468
name
469469
| _ ->
470-
L.die InternalError "Llair2Textual: unexpected type %a in %a at %a" Textual.Typ.pp
471-
textual_typ SourceFile.pp proc_state.sourcefile Textual.Location.pp loc
470+
L.internal_error "Llair2Textual: unexpected type %a in %a at %a" Textual.Typ.pp
471+
textual_typ SourceFile.pp proc_state.sourcefile Textual.Location.pp loc ;
472+
Textual.TypeName.mk_swift_type_name Textual.BaseTypeName.swift_any_type_name.value
472473
in
473474
let index_exp =
474475
Textual.Exp.Field {exp= rcd_exp; field= Field.tuple_field_of_pos type_name idx}

0 commit comments

Comments
 (0)