aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-02-14 15:17:44 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-03-06 22:57:53 +0100
commita69f8d70d4979e482214d9604ab4223dc3a00ed6 (patch)
tree810b2d2a5733c2b6698eecaea55931836f75b3d2
parent6bd31037f468ca68c1fea5463d8ff786618467cd (diff)
downloadsparse-a69f8d70d4979e482214d9604ab4223dc3a00ed6.tar.gz
ptrlist: use ptr_list_nth() instead of linearize_ptr_list()
Sparse has a few extra checkers for some functions. The one for memset has its own helper to retrieve its 3rd arguments. Remove this helper and use the generic ptr_list_nth() instead. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--sparse.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/sparse.c b/sparse.c
index 151eaf4e..9d62d4fe 100644
--- a/sparse.c
+++ b/sparse.c
@@ -163,20 +163,9 @@ static void check_byte_count(struct instruction *insn, pseudo_t count)
/* OK, we could try to do the range analysis here */
}
-static pseudo_t argument(struct instruction *call, unsigned int argno)
-{
- pseudo_t args[8];
- struct ptr_list *arg_list = (struct ptr_list *) call->arguments;
-
- argno--;
- if (linearize_ptr_list(arg_list, (void *)args, 8) > argno)
- return args[argno];
- return NULL;
-}
-
static void check_memset(struct instruction *insn)
{
- check_byte_count(insn, argument(insn, 3));
+ check_byte_count(insn, ptr_list_nth(insn->arguments, 3));
}
#define check_memcpy check_memset