Print this page
12724 update smatch to 0.6.1-rc1-il-5


 421                 expr_set_parent_expr(expr->right, expr);
 422 
 423                 __split_expr(expr->left);
 424                 __process_post_op_stack();
 425                 __split_expr(expr->right);
 426                 break;
 427         case EXPR_ASSIGNMENT: {
 428                 struct expression *right;
 429 
 430                 expr_set_parent_expr(expr->left, expr);
 431                 expr_set_parent_expr(expr->right, expr);
 432 
 433                 right = strip_expr(expr->right);
 434                 if (!right)
 435                         break;
 436 
 437                 __pass_to_client(expr, RAW_ASSIGNMENT_HOOK);
 438 
 439                 /* foo = !bar() */
 440                 if (__handle_condition_assigns(expr))
 441                         break;
 442                 /* foo = (x < 5 ? foo : 5); */
 443                 if (__handle_select_assigns(expr))
 444                         break;
 445                 /* foo = ({frob(); frob(); frob(); 1;}) */
 446                 if (__handle_expr_statement_assigns(expr))
 447                         break;
 448                 /* foo = (3, 4); */
 449                 if (handle_comma_assigns(expr))
 450                         break;
 451                 if (handle_postop_assigns(expr))
 452                         break;
 453                 if (handle__builtin_choose_expr_assigns(expr))
 454                         break;


 455 
 456                 __split_expr(expr->right);
 457                 if (outside_of_function())
 458                         __pass_to_client(expr, GLOBAL_ASSIGNMENT_HOOK);
 459                 else
 460                         __pass_to_client(expr, ASSIGNMENT_HOOK);
 461 
 462                 __fake_struct_member_assignments(expr);
 463 
 464                 /* Re-examine ->right for inlines.  See the commit message */
 465                 right = strip_expr(expr->right);
 466                 if (expr->op == '=' && right->type == EXPR_CALL)
 467                         __pass_to_client(expr, CALL_ASSIGNMENT_HOOK);
 468 
 469                 if (get_macro_name(right->pos) &&
 470                     get_macro_name(expr->pos) != get_macro_name(right->pos))
 471                         __pass_to_client(expr, MACRO_ASSIGNMENT_HOOK);
 472 

 473                 __pass_to_client(expr, ASSIGNMENT_HOOK_AFTER);
 474 
 475                 __split_expr(expr->left);
 476                 break;
 477         }
 478         case EXPR_DEREF:
 479                 expr_set_parent_expr(expr->deref, expr);
 480 
 481                 __pass_to_client(expr, DEREF_HOOK);
 482                 __split_expr(expr->deref);
 483                 break;
 484         case EXPR_SLICE:
 485                 expr_set_parent_expr(expr->base, expr);
 486 
 487                 __split_expr(expr->base);
 488                 break;
 489         case EXPR_CAST:
 490         case EXPR_FORCE_CAST:
 491                 expr_set_parent_expr(expr->cast_expression, expr);
 492 
 493                 __pass_to_client(expr, CAST_HOOK);
 494                 __split_expr(expr->cast_expression);




 421                 expr_set_parent_expr(expr->right, expr);
 422 
 423                 __split_expr(expr->left);
 424                 __process_post_op_stack();
 425                 __split_expr(expr->right);
 426                 break;
 427         case EXPR_ASSIGNMENT: {
 428                 struct expression *right;
 429 
 430                 expr_set_parent_expr(expr->left, expr);
 431                 expr_set_parent_expr(expr->right, expr);
 432 
 433                 right = strip_expr(expr->right);
 434                 if (!right)
 435                         break;
 436 
 437                 __pass_to_client(expr, RAW_ASSIGNMENT_HOOK);
 438 
 439                 /* foo = !bar() */
 440                 if (__handle_condition_assigns(expr))
 441                         goto after_assign;
 442                 /* foo = (x < 5 ? foo : 5); */
 443                 if (__handle_select_assigns(expr))
 444                         goto after_assign;
 445                 /* foo = ({frob(); frob(); frob(); 1;}) */
 446                 if (__handle_expr_statement_assigns(expr))
 447                         break;  // FIXME: got after
 448                 /* foo = (3, 4); */
 449                 if (handle_comma_assigns(expr))
 450                         goto after_assign;


 451                 if (handle__builtin_choose_expr_assigns(expr))
 452                         goto after_assign;
 453                 if (handle_postop_assigns(expr))
 454                         break;  /* no need to goto after_assign */
 455 
 456                 __split_expr(expr->right);
 457                 if (outside_of_function())
 458                         __pass_to_client(expr, GLOBAL_ASSIGNMENT_HOOK);
 459                 else
 460                         __pass_to_client(expr, ASSIGNMENT_HOOK);
 461 
 462                 __fake_struct_member_assignments(expr);
 463 
 464                 /* Re-examine ->right for inlines.  See the commit message */
 465                 right = strip_expr(expr->right);
 466                 if (expr->op == '=' && right->type == EXPR_CALL)
 467                         __pass_to_client(expr, CALL_ASSIGNMENT_HOOK);
 468 
 469                 if (get_macro_name(right->pos) &&
 470                     get_macro_name(expr->pos) != get_macro_name(right->pos))
 471                         __pass_to_client(expr, MACRO_ASSIGNMENT_HOOK);
 472 
 473 after_assign:
 474                 __pass_to_client(expr, ASSIGNMENT_HOOK_AFTER);

 475                 __split_expr(expr->left);
 476                 break;
 477         }
 478         case EXPR_DEREF:
 479                 expr_set_parent_expr(expr->deref, expr);
 480 
 481                 __pass_to_client(expr, DEREF_HOOK);
 482                 __split_expr(expr->deref);
 483                 break;
 484         case EXPR_SLICE:
 485                 expr_set_parent_expr(expr->base, expr);
 486 
 487                 __split_expr(expr->base);
 488                 break;
 489         case EXPR_CAST:
 490         case EXPR_FORCE_CAST:
 491                 expr_set_parent_expr(expr->cast_expression, expr);
 492 
 493                 __pass_to_client(expr, CAST_HOOK);
 494                 __split_expr(expr->cast_expression);