From bd9de9798748b9fbbed6b58c1188871bd43acbae Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 14 May 2018 14:40:38 +0300 Subject: [PATCH] function_ptrs: record local pointer scope correctly Say you have a function pointer that's local to a specific function, then that's supposed to be recorded as "function_name pointer_name". But the is_local_symbol() function always returned false so everything was treated as global. And then because there are a bunch of function pointer called "func", it meant they were all mixed together. Which was a mess because it meant that about a 100 functions were called with too much data and we just threw it all away. And probably there were some function which were called with not such common pointer names and so it was mixed with invalid data. Signed-off-by: Dan Carpenter --- smatch_function_ptrs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smatch_function_ptrs.c b/smatch_function_ptrs.c index f49402d7..9a897f9c 100644 --- a/smatch_function_ptrs.c +++ b/smatch_function_ptrs.c @@ -93,7 +93,7 @@ static int is_local_symbol(struct symbol *sym) { if (!sym || !(sym->ctype.modifiers & MOD_TOPLEVEL)) - return 0; + return 1; return 0; } -- 2.11.4.GIT