From 1577a92244797abebdfe9b9f01fe3568fa74a2b7 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 6 Mar 2014 13:33:14 +0300 Subject: [PATCH] clear_buffer: delete obsolete code to handle struct assignments This stuff is handled in smatch_struct_assignment.c now. Doing it here is duplicative (waste of memory and time). Also it was doing it in the wrong way so it meant that we set struct members equivalent to themselves. Signed-off-by: Dan Carpenter --- smatch_clear_buffer.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/smatch_clear_buffer.c b/smatch_clear_buffer.c index 7061f9e2..49d40266 100644 --- a/smatch_clear_buffer.c +++ b/smatch_clear_buffer.c @@ -189,16 +189,6 @@ int has_uninitialized_members(struct expression *expr) return 0; } -static void match_assign(struct expression *expr) -{ - struct symbol *type; - - type = get_type(expr->left); - if (!type || type->type != SYM_STRUCT) - return; - initialize_struct_members(type, expr->left, NULL); -} - static void match_alloc(const char *fn, struct expression *expr, void *_size_arg) { set_members_uninitialized(expr->left); @@ -262,7 +252,6 @@ void register_clear_buffer(int id) add_function_hook("usb_control_msg", &match_usb_control_msg, NULL); } add_modification_hook(my_id, &reset_initialized); - add_hook(&match_assign, ASSIGNMENT_HOOK); select_return_states_hook(PARAM_CLEARED, &db_param_cleared); } -- 2.11.4.GIT