|
|
@ -277,23 +277,20 @@ let captured_cxx_ref_in_objc_block_warning _ stmt_info captured_vars =
|
|
|
|
let bad_pointer_comparison_warning _ stmt_info stmts =
|
|
|
|
let bad_pointer_comparison_warning _ stmt_info stmts =
|
|
|
|
let rec condition stmts =
|
|
|
|
let rec condition stmts =
|
|
|
|
let condition_aux stmt =
|
|
|
|
let condition_aux stmt =
|
|
|
|
match stmt with
|
|
|
|
match (stmt: Clang_ast_t.stmt) with
|
|
|
|
| Clang_ast_t.CallExpr _
|
|
|
|
| BinaryOperator (_, _, _, boi) when
|
|
|
|
| Clang_ast_t.CXXMemberCallExpr _
|
|
|
|
(boi.boi_kind = `EQ) || (boi.boi_kind = `NE) -> false
|
|
|
|
| Clang_ast_t.CXXOperatorCallExpr _
|
|
|
|
| BinaryOperator (_, stmts, _, _) -> condition stmts
|
|
|
|
| Clang_ast_t.ObjCMessageExpr _ -> false
|
|
|
|
| UnaryOperator (_, stmts, _, uoi) when uoi.uoi_kind = `LNot ->
|
|
|
|
| Clang_ast_t.BinaryOperator (_, _, _, boi)
|
|
|
|
condition stmts
|
|
|
|
when (boi.boi_kind = `NE) || (boi.boi_kind = `EQ) -> false
|
|
|
|
| ImplicitCastExpr (_, stmts, _, _)
|
|
|
|
| Clang_ast_t.UnaryOperator (_, stmts, _, uoi) when uoi.uoi_kind = `LNot ->
|
|
|
|
| ExprWithCleanups (_, stmts, _, _) ->
|
|
|
|
condition stmts
|
|
|
|
condition stmts
|
|
|
|
| stmt ->
|
|
|
|
| stmt ->
|
|
|
|
match Clang_ast_proj.get_expr_tuple stmt with
|
|
|
|
match Clang_ast_proj.get_expr_tuple stmt with
|
|
|
|
| Some (_, stmts, expr_info) ->
|
|
|
|
| Some (_, _, expr_info) ->
|
|
|
|
let typ = CFrontend_utils.Ast_utils.get_desugared_type expr_info.ei_type_ptr in
|
|
|
|
let typ = CFrontend_utils.Ast_utils.get_desugared_type expr_info.ei_type_ptr in
|
|
|
|
if CFrontend_utils.Ast_utils.is_ptr_to_objc_class typ "NSNumber" then
|
|
|
|
CFrontend_utils.Ast_utils.is_ptr_to_objc_class typ "NSNumber"
|
|
|
|
true
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
condition stmts
|
|
|
|
|
|
|
|
| _ -> false in
|
|
|
|
| _ -> false in
|
|
|
|
IList.exists condition_aux stmts in
|
|
|
|
IList.exists condition_aux stmts in
|
|
|
|
if condition stmts then
|
|
|
|
if condition stmts then
|
|
|
|