403
404 expr = strip_expr_set_parent(expr);
405 if (!expr) {
406 __fold_in_set_states();
407 return;
408 }
409
410 /*
411 * On fast paths (and also I guess some people think it's cool) people
412 * sometimes use | instead of ||. It works the same basically except
413 * that || implies a memory barrier between conditions. The easiest way
414 * to handle it is by pretending that | also has a barrier and re-using
415 * all the normal condition code. This potentially hides some bugs, but
416 * people who write code like this should just be careful or they
417 * deserve bugs.
418 *
419 * We could potentially treat boolean bitwise & this way but that seems
420 * too complicated to deal with.
421 */
422 if (expr->type == EXPR_BINOP && expr->op == '|') {
423 handle_logical(expr);
424 return;
425 }
426
427 switch (expr->type) {
428 case EXPR_LOGICAL:
429 expr_set_parent_expr(expr->left, expr);
430 expr_set_parent_expr(expr->right, expr);
431 __pass_to_client(expr, LOGIC_HOOK);
432 handle_logical(expr);
433 return;
434 case EXPR_COMPARE:
435 expr_set_parent_expr(expr->left, expr);
436 expr_set_parent_expr(expr->right, expr);
437 hackup_unsigned_compares(expr);
438 if (handle_zero_comparisons(expr))
439 return;
440 break;
441 case EXPR_CALL:
442 if (ignore_builtin_expect(expr))
|
403
404 expr = strip_expr_set_parent(expr);
405 if (!expr) {
406 __fold_in_set_states();
407 return;
408 }
409
410 /*
411 * On fast paths (and also I guess some people think it's cool) people
412 * sometimes use | instead of ||. It works the same basically except
413 * that || implies a memory barrier between conditions. The easiest way
414 * to handle it is by pretending that | also has a barrier and re-using
415 * all the normal condition code. This potentially hides some bugs, but
416 * people who write code like this should just be careful or they
417 * deserve bugs.
418 *
419 * We could potentially treat boolean bitwise & this way but that seems
420 * too complicated to deal with.
421 */
422 if (expr->type == EXPR_BINOP && expr->op == '|') {
423 expr_set_parent_expr(expr->left, expr);
424 expr_set_parent_expr(expr->right, expr);
425 handle_logical(expr);
426 return;
427 }
428
429 switch (expr->type) {
430 case EXPR_LOGICAL:
431 expr_set_parent_expr(expr->left, expr);
432 expr_set_parent_expr(expr->right, expr);
433 __pass_to_client(expr, LOGIC_HOOK);
434 handle_logical(expr);
435 return;
436 case EXPR_COMPARE:
437 expr_set_parent_expr(expr->left, expr);
438 expr_set_parent_expr(expr->right, expr);
439 hackup_unsigned_compares(expr);
440 if (handle_zero_comparisons(expr))
441 return;
442 break;
443 case EXPR_CALL:
444 if (ignore_builtin_expect(expr))
|