From 3c6317abbff40282a8b1de9d374fc19a7849dce6 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 25 May 2010 15:30:34 +0200 Subject: [PATCH] hooks: add LOGIC_HOOK It passed both || type logical things and comparisons. I wanted both and I couldn't think of a good name for the combined hook. Naming is easy to fix later on if it becomes a problem. Signed-off-by: Dan Carpenter --- smatch.h | 1 + smatch_flow.c | 1 + smatch_hooks.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/smatch.h b/smatch.h index 4aca0909..683565a7 100644 --- a/smatch.h +++ b/smatch.h @@ -69,6 +69,7 @@ enum hook_type { STRING_HOOK, DECLARATION_HOOK, ASSIGNMENT_HOOK, + LOGIC_HOOK, CONDITION_HOOK, WHOLE_CONDITION_HOOK, FUNCTION_CALL_HOOK, diff --git a/smatch_flow.c b/smatch_flow.c index 4c8a9bcc..b8aec83f 100644 --- a/smatch_flow.c +++ b/smatch_flow.c @@ -107,6 +107,7 @@ void __split_expr(struct expression *expr) break; case EXPR_LOGICAL: case EXPR_COMPARE: + __pass_to_client(expr, LOGIC_HOOK); __handle_logic(expr); break; case EXPR_BINOP: diff --git a/smatch_hooks.c b/smatch_hooks.c index 84291569..a5cbd5a5 100644 --- a/smatch_hooks.c +++ b/smatch_hooks.c @@ -68,6 +68,9 @@ void add_hook(void *func, enum hook_type type) case OP_HOOK: container->data_type = EXPR_PTR; break; + case LOGIC_HOOK: + container->data_type = EXPR_PTR; + break; case CONDITION_HOOK: container->data_type = EXPR_PTR; break; -- 2.11.4.GIT