[clang] Make an assert false into incorrect_assumption as it is happening in prod

Reviewed By: mbouaziz

Differential Revision: D8004365

fbshipit-source-id: 0f77515
master
Dulma Churchill 7 years ago committed by Facebook Github Bot
parent 1898ef3a7a
commit 87d1f0f241

@ -163,7 +163,15 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
infer needs it to be T& *) infer needs it to be T& *)
let exec_with_glvalue_as_reference f trans_state stmt = let exec_with_glvalue_as_reference f trans_state stmt =
let expr_info = let expr_info =
match Clang_ast_proj.get_expr_tuple stmt with Some (_, _, ei) -> ei | None -> assert false match Clang_ast_proj.get_expr_tuple stmt with
| Some (_, _, ei) ->
ei
| None ->
let stmt_info, _ = Clang_ast_proj.get_stmt_tuple stmt in
CFrontend_config.incorrect_assumption __POS__ stmt_info.Clang_ast_t.si_source_range
"Clang_ast_proj.get_expr_tuple stmt returns None, stmt is %a"
(Pp.to_string ~f:Clang_ast_j.string_of_stmt)
stmt
in in
let res_trans = f trans_state stmt in let res_trans = f trans_state stmt in
let return = let return =

Loading…
Cancel
Save